- 目前只支持 h5 以及微信小程序,暂不支持其他端
yarn add taro-react-uilib
npm install taro-react-uilib
config/index.js
const config = {
// 其他配置
...
h5.esnextModules: ['taro-uilib']
// 其他配置
...
}
yarn add babel-plugin-import -D
{
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....
...
]
}