«

配置Vant-ui

yang 发布于 阅读:376 Vue2阶段


官方文档:https://vant-contrib.gitee.io/vant/v2/#/zh-CN/quickstart

第一步:安装vant-ui

yarn add vant@latest-v2

第二步:引入vant-ui

//安装按需引入插件
npm i babel-plugin-import -D

//可以在 babel.config.js 中配置
module.exports = {
  plugins: [
    ['import', {
      libraryName: 'vant',
      libraryDirectory: 'es',
      style: true
    }, 'vant']
  ]
};

//按需引入vant-ui组件
import { Button, Rate } from 'vant';
import 'vant/lib/index.css';
Vue.use(Button).use(Rate);

第三步:打开官网复制代码

<van-button type="info">信息按钮</van-button>
<van-rate v-model="value" allow-half void-icon="star" void-color="#eee" />

版权所有:微4e
文章标题:配置Vant-ui
除非注明,文章均为 微4e 原创,请勿用于任何商业用途,禁止转载

推荐阅读:


扫描二维码,在手机上阅读
请先 登录 再评论