1、先安装
npm i vant
如果不行安装这个
yarn add vant
2、在main.js中引入即可
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import { Button } from 'vant';
import 'vant/lib/index.css';
createApp(App).use(Button).use(store).use(router).mount('#app')
3、然后在需要的页面使用就可以了
<van-button type="primary">主要按钮</van-button>
<van-button type="success">成功按钮</van-button>
<van-button type="default">默认按钮</van-button>
<van-button type="warning">警告按钮</van-button>
<van-button type="danger">危险按钮</van-button>
4、结果截图
运行效果