Skip to content

Commit

Permalink
docs: 补充小程序开放能力组件文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen-jj committed Aug 26, 2019
1 parent 90200ba commit 923fc9d
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 10 deletions.
37 changes: 37 additions & 0 deletions docs/components/open/ad.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Ad
sidebar_label: Ad
---

##### Banner 广告

> 组件 支持度
| 微信小程序 |
| :-: |
||


>具体用法请看小程序官方文档
[微信小程序 Ad](https://developers.weixin.qq.com/miniprogram/dev/component/ad.html)

```jsx
import Taro, { Component } from '@tarojs/taro'
// 引入 Ad 组件
import { Ad } from '@tarojs/components'

class App extends Component {
render () {
return (
<Ad
unit-id=''
ad-intervals={60}
onLoad={() => console.log('ad onLoad')}
onError={() => console.log('ad onError')}
onClose={() => console.log('ad onClose')}
/>
)
}
}
```
34 changes: 34 additions & 0 deletions docs/components/open/official-account.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: OfficialAccount
sidebar_label: OfficialAccount
---

##### 公众号关注组件。当用户扫小程序码打开小程序时,开发者可在小程序内配置公众号关注组件,方便用户快捷关注公众号,可嵌套在原生组件内。

> 组件 支持度
| 微信小程序 |
| :-: |
||


>具体用法请看小程序官方文档
[微信小程序 OfficialAccount](https://developers.weixin.qq.com/miniprogram/dev/component/official-account.html)

```jsx
import Taro, { Component } from '@tarojs/taro'
// 引入 OfficialAccount 组件
import { OfficialAccount } from '@tarojs/components'

class App extends Component {
render () {
return (
<OfficialAccount
onLoad={() => console.log('official-account onLoad')}
onError={() => console.log('official-account onError')}
/>
)
}
}
```
32 changes: 23 additions & 9 deletions docs/components/open/open-data.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
---
title: 其他
sidebar_label: 其他
title: OpenData
sidebar_label: OpenData
---

##### 其他组件
##### 用于展示小程序开放的数据。

除导航列表的一些组件外,还有一些差异化组件,每个端不同,后续计划将这些统一封装。目前差异化组件请详看各小程序官网。
> 组件 支持度
>其他组件请看各小程序官方文档
| 微信小程序 | 百度小程序 |
| :-: | :-: |
|||

[微信小程序](https://developers.weixin.qq.com/miniprogram/dev/component/)

[百度小程序](https://smartprogram.baidu.com/docs/develop/component/view/)
>具体用法请看小程序官方文档
[支付宝小程序](https://docs.alipay.com/mini/component/overview)
[微信小程序 OpenData](https://developers.weixin.qq.com/miniprogram/dev/component/open-data.html)

[字节跳动小程序](https://developer.toutiao.com/docs/comp/)
[百度小程序 OpenData](https://smartprogram.baidu.com/docs/develop/component/open/#open-data/)

```jsx
import Taro, { Component } from '@tarojs/taro'
// 引入 Ad 组件
import { OpenData } from '@tarojs/components'

class App extends Component {
render () {
return (
<OpenData type=''/>
)
}
}
```
19 changes: 19 additions & 0 deletions docs/components/open/others.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: 其他
sidebar_label: 其他
---

##### 其他组件

除导航列表的一些组件外,还有一些差异化组件,每个端不同,后续计划将这些统一封装。目前差异化组件请详看各小程序官网。

>其他组件请看各小程序官方文档
[微信小程序](https://developers.weixin.qq.com/miniprogram/dev/component/)

[百度小程序](https://smartprogram.baidu.com/docs/develop/component/view/)

[支付宝小程序](https://docs.alipay.com/mini/component/overview)

[字节跳动小程序](https://developer.toutiao.com/docs/comp/)

12 changes: 12 additions & 0 deletions website/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,19 @@
"title": "Navigator",
"sidebar_label": "Navigator"
},
"components/open/ad": {
"title": "Ad",
"sidebar_label": "Ad"
},
"components/open/official-account": {
"title": "OfficialAccount",
"sidebar_label": "OfficialAccount"
},
"components/open/open-data": {
"title": "OpenData",
"sidebar_label": "OpenData"
},
"components/open/others": {
"title": "其他",
"sidebar_label": "其他"
},
Expand Down
5 changes: 4 additions & 1 deletion website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,11 @@
"components/canvas/canvas"
],
"开放能力": [
"components/open/ad",
"components/open/official-account",
"components/open/open-data",
"components/open/web-view",
"components/open/open-data"
"components/open/others"
]
},
"API": {
Expand Down

0 comments on commit 923fc9d

Please sign in to comment.