廢話不說,直接寫步驟css
1.vue
npm install vux --save
2.webpack
npm install less less-loader --save-dev
3.web
npm install @vux/loader --save-dev
4.npm
npm install yaml-loader --save-dev
使用,以toast爲例:less
main.js:ui
import '@/styles/index.scss'
import { ToastPlugin } from 'vux'
this.$vux.toast.text('hello', 'top')
寫在最後:this
估計都會遇到官網關於配置vux-loader方式報錯問題,由於如今cli3.0已是用webpack4了,vux-loader也提供@vux/loader了,spa
項目根目錄下新建vue.config.jscode
module.exports = { configureWebpack: config => { require('@vux/loader').merge(config, { options: {}, plugins: ['vux-ui'] }) }, };