0.0.4 • Published 3 years ago

@tarojs/plugin-platform-alipay-iot v0.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

@tarojs/plugin-platform-alipay-iot

Taro 插件。用于支持编译为支付宝 IOT 端小程序。

使用

1. 配置插件

// Taro 项目配置
module.exports = {
  // ...
  plugins: [
    '@tarojs/plugin-platform-alipay-iot'
  ]
}

2. 编译为支付宝 IOT 端小程序

taro build --type iot
taro build --type iot --watch

其它

平台判断
if (process.TARO_ENV === 'iot') {
  // ...
}
API

支付宝 IOT 端小程序拓展了一些独有 API,可以通过 Taro.iot.xxx 来调用,例:

Taro.ix.getSysProp({
  key: 'ro.serialno'
})
  .then(res => console.log(res))
组件

支付宝 IOT 端小程序拓展了一些独有组件,可像普通 Taro 内置组件一样使用,例:

import { Poster, IxGrid, IxNativeList, IxNativeGrid } from '@tarojs/components'

function Index () {
  return (
    <>
      <Poster></Poster>
      <IxGrid></IxGrid>
      <IxNativeList></IxNativeList>
      <IxNativeGrid></IxNativeGrid>
    </>
  )
}