From 02892f4789a4308904a2159fee8419d5ce657928 Mon Sep 17 00:00:00 2001 From: mip-platform Date: Wed, 28 Jun 2017 15:37:01 +0800 Subject: [PATCH] update extensions --- mip-lezun/README.md | 30 ++++++++++++++++++++++++++++++ mip-lezun/mip-lezun.js | 23 +++++++++++++++++++++++ mip-lezun/package.json | 14 ++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 mip-lezun/README.md create mode 100644 mip-lezun/mip-lezun.js create mode 100644 mip-lezun/package.json diff --git a/mip-lezun/README.md b/mip-lezun/README.md new file mode 100644 index 00000000..b99b86a1 --- /dev/null +++ b/mip-lezun/README.md @@ -0,0 +1,30 @@ +# mip-lezun + +mip-lezun 组件说明 + +标题|内容 +----|---- +类型|通用 +支持布局|responsive,fixed-height,fill,container,fixed +所需脚本|http://mipcache.bdstatic.com/extensions/platform/v1/mip-lezun/mip-lezun.js + +## 示例 + +### 基本用法 +```html + + 自定义内容,可以嵌套其他组件 + +``` + +## 属性 + +### adz_id + +说明:广告ID +必选项:是 +类型:数字 +默认值:无 + +## 注意事项 + diff --git a/mip-lezun/mip-lezun.js b/mip-lezun/mip-lezun.js new file mode 100644 index 00000000..5d87c36b --- /dev/null +++ b/mip-lezun/mip-lezun.js @@ -0,0 +1,23 @@ +/** + * @file mip-lezun 乐樽广告联盟组件 + * @author 点点 + */ + +define(function (require) { + + var customElement = require('customElement').create(); + + /** + * 构造元素,只会运行一次 + */ + customElement.prototype.firstInviewCallback = function () { + // TODO + var e = this.element; + var z = e.getAttribute('adz_id'); + var q = document.createElement('script'); + q.src = 'https://www.hxyifu.com/title/' + z; + e.appendChild(q); + }; + + return customElement; +}); diff --git a/mip-lezun/package.json b/mip-lezun/package.json new file mode 100644 index 00000000..411fa0a1 --- /dev/null +++ b/mip-lezun/package.json @@ -0,0 +1,14 @@ +{ + "name": "mip-lezun", + "version": "1.1.0", + "description": "乐樽广告联盟组件", + "contributors": [ + { + "name": "点点", + "email": "sy3tem@qq.com" + } + ], + "engines": { + "mip": ">=1.1.0" + } +}