taro-react-uilib
TypeScript icon, indicating that this package has built-in type declarations

1.4.7 • Public • Published

基于 taro 的多端 UI 组件库

特性

  • 目前只支持 h5 以及微信小程序,暂不支持其他端

使用

yarn add taro-react-uilib
npm install taro-react-uilib

配置

config/index.js

const config = {
  // 其他配置
  ...
  h5.esnextModules: ['taro-uilib']
  // 其他配置
  ...
}

按需加载

首先引入 babel-plugin-import

yarn add babel-plugin-import -D

配置 babel-plugin-import 在 babel-config.js 里

{
  plugins: [
    [
      'import',
      {
        libraryName: 'taro-react-uilib',
        customName: name => {
          const finalName = name.replace(/XH/, '')
          return `taro-react-uilib/dist/components/${finalName}`
        },
        camel2DashComponentName: false,
        style: name => {
          const componentsName = name.split('/').pop().toLocaleLowerCase()
          return `taro-react-uilib/dist/styles/components/${componentsName}.scss`
        }
      },
      'taro-react-uilib'
    ]
    // others....
    ...
  ]
}

Readme

Keywords

Package Sidebar

Install

npm i taro-react-uilib

Weekly Downloads

3

Version

1.4.7

License

MIT

Unpacked Size

2.91 MB

Total Files

544

Last publish

Collaborators

  • xiongshiji
  • xiao_xue