react+taro中使用vant 工具:taroify

前言:

react+taro中使用vant的工具:taroify 。我们在开发移动端时候,vant是非常好用的,有他的vue移动端版本,小程序版本,现在来说下他的react移动端版本。

官网地址:

https://taroify.github.io/taroify.com/introduce/https://taroify.github.io/taroify.com/introduce/

源码地址:

https://gitee.com/mallfoundry/taroify#https://taroify.gitee.io/taroify.com/quickstart/https://gitee.com/mallfoundry/taroify#https://taroify.gitee.io/taroify.com/quickstart/

使用教程:

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>
相关推荐
kyle~17 分钟前
C++--- override 关键字 强制编译器验证当前函数是否重写基类的虚函数
java·前端·c++
Light6031 分钟前
像素退场,曲线登场:现代响应式 CSS 全家桶 | 领码课堂
前端·css·响应式设计·css函数·布局系统·相对单位·设计令牌
爱生活的苏苏1 小时前
elementUI 表单验证-联动型校验
前端·javascript·elementui
一只小风华~3 小时前
Vue Router 路由元信息(meta)详解
前端·javascript·vue.js
*且听风吟3 小时前
html 实现鼠标滑动点亮横轴
前端·javascript·html
iCoding915 小时前
前端分页 vs 后端分页:技术选型
前端·后端·系统架构
mingtianyihou335 小时前
使用 Service Worker 限制请求并发数
前端
张可爱5 小时前
20251017-Vue2八股文整理(上篇)
前端
FanetheDivine5 小时前
ts中如何描述一个复杂函数的类型
前端·typescript
lightgis5 小时前
chrome中的axure插件提示无法不受支持
前端·chrome