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>
相关推荐
空中湖27 分钟前
Spring AI Agent 编排:ReAct 模式 + 多 Agent 协作实战
人工智能·spring·react.js
吃糖的小孩41 分钟前
从只读页面到可控真实探针:我如何给 Owner Console 加手动诊断
前端
谷无姜41 分钟前
为什么你的性能优化无效?可能是"木桶效应"在作祟
前端·性能优化
雾非雾1 小时前
《基于具身交互智能数字人技术:如何打造AI数字人宣讲平台"红厅智播”》
前端
Revolution611 小时前
一段 JavaScript 代码执行时,到底发生了什么
前端·javascript
智能起源1 小时前
关于元素层级过多,导致压祯的问题(使用winform或者WPF应用的webview组件嵌套网页时,动效卡顿问题)
前端
Old Uncle Tom2 小时前
银行用户画像 -- 金融目标与需求意图
前端·人工智能·金融
IT_陈寒2 小时前
Vue的响应式让我加班到凌晨3点,原来问题出在这
前端·人工智能·后端
东方小月2 小时前
从0开发一个 Coding Agent(一):前言
前端·人工智能·typescript