前言:
react+taro中使用vant的工具:taroify 。我们在开发移动端时候,vant是非常好用的,有他的vue移动端版本,小程序版本,现在来说下他的react移动端版本。
官网地址:
https://taroify.github.io/taroify.com/introduce/https://taroify.github.io/taroify.com/introduce/
源码地址:
使用教程:
1、安装
javascript
npm i @taroify/core
2、全局引入css样式,下面的二选一
javascript
// app.ts
import "@taroify/icons/index.scss"
import "@taroify/core/index.scss"
// css
import "@taroify/icons/index.css"
import "@taroify/core/index.css"
3、如果你不需要那么多css,比如只要一个button的话,就按需引入
4、具体使用
javascript
import { Button } from "@taroify/core"
<Button color="primary">主要按钮</Button>