taro-van
v2.5.2
Published
taro ui库,提供好用的Form表单
Downloads
250
Readme
介绍
Taro Van 是一款基于 Taro 框架开发的多端 UI 组件库
快速上手
通过 npm 安装
在现有项目中使用 Taro-Van 时,可以通过 npm 进行安装:
npm i taro-van
当然,你也可以通过 yarn 或 pnpm 进行安装:
# 通过 yarn 安装
yarn add taro-van
# 通过 pnpm 安装
pnpm add taro-van
引入组件
方式一:手动按需引入
import Button from 'taro-van/lib/src/components/button';
import 'taro-van/lib/styles/components/button.less';
方式二:导入所有组件样式
在入口文件引入taro-van
的所有样式。
import 'taro-van/lib/styles/index.less';
解决样式引入问题
在 config/index.js 文件中添加如下代码:
const config = {
...
h5: {
esnextModules: ['taro-van'],
}
...
}
示例
import { View } from '@tarojs/components';
import { Button } from 'taro-van';
export default () => {
return (
<View className='wrapper'>
<Button type='primary'>按钮</Button>
</View>
);
};