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>
相关推荐
lichenyang45316 小时前
Docker 学习笔记(一):为什么需要镜像、容器和仓库?
前端
kyriewen16 小时前
别再对着 TypeScript 报错发呆了:我把 10 个最常见的红色波浪线翻译成了人话
前端·javascript·typescript
IT_陈寒16 小时前
SpringBoot自动配置的坑,我的API突然就404了
前端·人工智能·后端
奇奇怪怪的17 小时前
Embedding 模型 10+ 横向评测
前端
陈广亮17 小时前
Monorepo 从 0 到 1 实操指南 2026 版:pnpm catalogs + Turborepo 2.x + changesets 全链路
前端
子兮曰17 小时前
OpenMontage 深度解剖:你的 AI 编程助手,其实是个视频工作室
前端·后端·ai编程
敲代码的鱼17 小时前
PDF 预览与签名批注写回 支持安卓 iOS 鸿蒙 UTS插件
android·前端·ios
子兮曰18 小时前
前端工具链的「Rust 化」:一场没有赢家的军备竞赛?
前端·后端·rust
Hyyy19 小时前
Function Calling / Tool Use的原理和实现模式
前端·llm·ai编程