vue-cli3.0 使用vux
- install vux(dependencies)
npm install vux --save
複製代碼
- install vux-loader(devDependencies) --must be installed
npm install vux-loader --save-dev
複製代碼
- install less-loader(devDependencies) --must be installed
npm install less less-loader --save-dev
複製代碼
- config vux environment 正常狀況下配置的vue-loader可能會致使錯誤,因此手動指定vue-loader版原本解決加載問題
npm install vue-loader@14.2.2 -D
複製代碼
- config vue.config.js
module.exports = {
// add begin
configureWebpack: config => {
require('vux-loader').merge(config, {
options: {},
plugins: ['vux-ui']
})
}
// add end
}
複製代碼
- use vux in (hello-world/src/views/order/Undone.vue)
<x-header></x-header>
import {XHeader} from 'vux'
export default {
components: {
Xheader
}
}
複製代碼