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 小时前
Python 中的自然语言处理利器:NLTK
前端·javascript·easyui
Swift社区8 小时前
Nginx 反向代理配置 React 前端与 Python 后端
前端·nginx·react.js
可问春风_ren9 小时前
Vue3 入门详解:从基础到实战
开发语言·前端·javascript·vue.js·前端框架·ecmascript·edge浏览器
摘星编程9 小时前
用React Native开发OpenHarmony应用:NativeStack原生导航
javascript·react native·react.js
一起养小猫9 小时前
Flutter for OpenHarmony 实战:从零开发一款五子棋游戏
android·前端·javascript·flutter·游戏·harmonyos
晚霞的不甘9 小时前
Flutter for OpenHarmony全面升级「今日运势」 应用的视觉与交互革新
前端·学习·flutter·前端框架·交互
学嵌入式的小杨同学9 小时前
【Linux 封神之路】文件操作 + 时间编程实战:从缓冲区到时间格式化全解析
linux·c语言·开发语言·前端·数据库·算法·ux
●VON9 小时前
从像素到语义:React Native Text 组件在 OpenHarmony 上的渲染哲学与工程实现
android·react native·react.js
RFCEO9 小时前
学习前端编程:精准选中 HTML 元素的技巧与方法
前端·学习·css类选择器·兄弟元素选中·父子选中·关系选中·选择器选中
想睡好9 小时前
ref和reactive
前端·javascript·vue.js