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

2.5.2 • Public • Published

介绍

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>
  );
};

Readme

Keywords

Package Sidebar

Install

npm i taro-van

Weekly Downloads

2

Version

2.5.2

License

MIT

Unpacked Size

1.21 MB

Total Files

328

Last publish

Collaborators

  • wjun21