https://github.com/nervjs/taro-plugin-platform-alipay-iot
支付宝 IOT 端小程序平台插件
https://github.com/nervjs/taro-plugin-platform-alipay-iot
Last synced: 11 months ago
JSON representation
支付宝 IOT 端小程序平台插件
- Host: GitHub
- URL: https://github.com/nervjs/taro-plugin-platform-alipay-iot
- Owner: NervJS
- Created: 2020-10-10T03:34:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-12T12:04:55.000Z (over 5 years ago)
- Last Synced: 2025-06-04T12:47:54.364Z (about 1 year ago)
- Language: TypeScript
- Size: 34.2 KB
- Stars: 2
- Watchers: 16
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `@tarojs/plugin-platform-alipay-iot`
Taro 插件。用于支持编译为支付宝 IOT 端小程序。
## 使用
#### 1. 配置插件
```js
// Taro 项目配置
module.exports = {
// ...
plugins: [
'@tarojs/plugin-platform-alipay-iot'
]
}
```
#### 2. 编译为支付宝 IOT 端小程序
```shell
taro build --type iot
taro build --type iot --watch
```
#### 其它
##### 平台判断
```js
if (process.TARO_ENV === 'iot') {
// ...
}
```
##### API
支付宝 IOT 端小程序拓展了一些独有 API,可以通过 `Taro.iot.xxx` 来调用,例:
```js
Taro.ix.getSysProp({
key: 'ro.serialno'
})
.then(res => console.log(res))
```
##### 组件
支付宝 IOT 端小程序拓展了一些独有组件,可像普通 Taro 内置组件一样使用,例:
```js
import { Poster, IxGrid, IxNativeList, IxNativeGrid } from '@tarojs/components'
function Index () {
return (
<>
>
)
}
```