-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78ddb62
commit 2ece598
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# mip-51la | ||
|
||
mip-51la 组件说明 | ||
|
||
标题|内容 | ||
----|---- | ||
类型|通用 | ||
支持布局|responsive,fixed-height,fill,container,fixed | ||
所需脚本|http://mipcache.bdstatic.com/static/v1/mip-51la/mip-51la.js | ||
|
||
## 示例 | ||
|
||
### 基本用法 | ||
```html | ||
<mip-51la sid="123456"> | ||
自定义内容,可以嵌套其他组件 | ||
</mip-51la> | ||
``` | ||
|
||
## 属性 | ||
|
||
### {sid} | ||
|
||
说明:{站点id} | ||
必选项:{是} | ||
类型:{数字} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* @file mip-51la 组件 | ||
* @author 点点 | ||
*/ | ||
|
||
define(function (require) { | ||
|
||
var customElement = require('customElement').create(); | ||
|
||
/** | ||
* 构造元素,只会运行一次 | ||
*/ | ||
customElement.prototype.createdCallback = function () { | ||
// TODO | ||
var e = this.element; | ||
var s = e.getAttribute('sid'); | ||
var d = document.createElement('script'); | ||
d.src = 'https://js.users.51.la/' + s + '.js'; | ||
e.appendChild(d); | ||
}; | ||
|
||
return customElement; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "mip-51la", | ||
"version": "1.0.0", | ||
"description": "51la统计用", | ||
"contributors": [ | ||
{ | ||
"name": "点点", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"engines": { | ||
"mip": ">=1.1.0" | ||
} | ||
} |