Skip to content

Commit

Permalink
update extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
mip-platform committed Jun 16, 2017
1 parent 78ddb62 commit 2ece598
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
28 changes: 28 additions & 0 deletions mip-51la/README.md
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}
必选项:{是}
类型:{数字}


23 changes: 23 additions & 0 deletions mip-51la/mip-51la.js
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;
});
14 changes: 14 additions & 0 deletions mip-51la/package.json
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"
}
}

0 comments on commit 2ece598

Please sign in to comment.