Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[platform] king4399 提交组件改动:mip-bnmanhua-ws #214

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions mip-bnmanhua-ws/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# mip-bnmanhua-ws

mip-bnmanhua-ws 用于投放第本站产品

标题|内容
----|----
类型|广告
支持布局|responsive,fixed-height,fill,container,fixed
所需脚本|http://mipcache.bdstatic.com/extensions/platform/v1/mip-bnmanhua-ws/mip-bnmanhua-ws.js

## 示例

### 基本用法
```html
<mip-fixed type="bottom" id="bnmanhua-ws">
<mip-bnmanhua-ws></mip-bnmanhua-ws>
</mip-fixed>
```

## 属性

### mip-bnmanhua-ws

说明:用于投放第本站产品 , 在组件中以图片的形式展示
必选项:否
27 changes: 27 additions & 0 deletions mip-bnmanhua-ws/mip-bnmanhua-ws.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* @file mip-bnmanhua-ws
*
* @author bnmanhua
*/

define(function (require) {
var $ = require('zepto');
var mip = $('mip-bnmanhua-ws');
var customElement = require('customElement').create();

/**
* 构造元素,只会运行一次
*/
customElement.prototype.build = function () {
var node = document.createElement('script');
node.type = 'text/javascript';
node.src = 'https://www.bnmanhua.com/mip/bnmanhua.js';
node.async = 'true';
var parent = document.getElementsByTagName('head')[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不允许插入第三方 js。参考组件规范

if (parent) {
parent.insertBefore(node, parent.firstChild);
}
};

return customElement;
});
15 changes: 15 additions & 0 deletions mip-bnmanhua-ws/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "mip-bnmanhua-ws",
"version": "1.0.0",
"description": "用于投放第本站产品广告",
"contributors": [
{
"name": "bnmanhua",
"email": "513741179@qq.com",
"url": "https://www.bnmanhua.com/"
}
],
"engines": {
"mip": ">=1.1.0"
}
}