1、安装 vant: npm i vant -S
2、main.js引用(可按需引用)
//按需引用 import { Button } from ‘vant‘
import ‘vant/lib/button/style‘ //引入样式或者下载 vant.min.css,在根目录index.html引用
Vue.use(Button) //全部引用 import vant from ‘vant‘ Vue.use(vant )
3、使用
<van-button type="default">默认按钮</van-button> <van-button type="primary">主要按钮</van-button> <van-button type="info">信息按钮</van-button> <van-button type="warning">警告按钮</van-button>
4、效果展示