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>
相关推荐
紫禁玄科8 小时前
Shai-Hulud:npm生态的自我复制蠕虫风暴
前端·npm·node.js
东风破_9 小时前
后端API没写好,前端难道干等着吗?
前端
百变梦仔9 小时前
从读项目到纠偏交付:我把 Codex 前端任务闭环升级成了第二版
前端
用户938515635079 小时前
从前后端分离到前端接口工程:React + MockJS + Vite 解析
前端·后端·全栈
用户938515635079 小时前
从零在浏览器里跑 DeepSeek-R1:WebGPU + Transformers.js 全链路实战(三)
前端·react.js·typescript
excel9 小时前
当前端行情变差,我们为什么还要坚持?
前端
鸿是江边鸟,曾是心上人10 小时前
快速搭建HTTPS本地开发环境
前端
To_OC10 小时前
写了 5 个表单 Demo 后,我终于彻底搞懂了 React 受控与非受控组件
前端·react.js·前端框架
Sterting11 小时前
第9课 Vue Router 路由
前端·vue.js
用户0595401744611 小时前
LangChain Memory 测试踩坑实录:用 pytest 自动化回归对话记忆,我折腾了整整一个周末
前端·css