新建vue項(xiàng)目
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install vue-cli -g
vue init webpack my-project
cnpm install node-sass sass-loader less less-loader --save-dev
cnpm install axios --save
cnpm install vuex --save
cnpm install js-cookie --save
cnpm install iview --save
cnpm install element-ui --save
增加路徑別名
修改文件:webpack.base.conf.js
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
'util': '@/util',
'asset': '@/asset'
...
}
}