Skip to content

Commit

Permalink
add nodisplay layout and prerenderAllowed true (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brunoon authored and clark-t committed Aug 29, 2019
1 parent e729a79 commit edfe5c7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/mip-linksubmit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
标题|内容
----|----
类型|通用
支持布局|N/S
支持布局|nodisplay
所需脚本| [https://c.mipcdn.com/static/v2/mip-linksubmit/mip-linksubmit.js](https://c.mipcdn.com/static/v2/mip-linksubmit/mip-linksubmit.js)

## 说明
Expand All @@ -15,7 +15,7 @@
## 示例

```html
<mip-linksubmit type="baidu"></mip-linksubmit>
<mip-linksubmit type="baidu" layout="nodisplay"></mip-linksubmit>
```

## 属性
Expand Down
8 changes: 7 additions & 1 deletion components/mip-linksubmit/example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@
<link rel="stylesheet" href="https://c.mipcdn.com/static/v2/mip.css">
<style mip-custom>
/* 自定义样式 */
.content {
height: 2000px;
width: 300px;
background: #ccc;
}
</style>
</head>
<body>
<div class="content"></div>
<div>
<mip-linksubmit type="baidu"></mip-linksubmit>
<mip-linksubmit type="baidu" layout="nodisplay"></mip-linksubmit>
</div>
<script src="https://c.mipcdn.com/static/v2/mip.js"></script>
<script src="/mip-linksubmit/mip-linksubmit.js"></script>
Expand Down
4 changes: 4 additions & 0 deletions components/mip-linksubmit/mip-linksubmit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export default class MIPLinksubmit extends MIP.CustomElement {
prerenderAllowed () {
return true
}

build () {
const type = this.element.getAttribute('type') || ''
const bp = document.createElement('script')
Expand Down

0 comments on commit edfe5c7

Please sign in to comment.