2 添加less , cnpm i less less-loader javascript
複製代碼
-D (iview 樣式是基於less開發的)
vue
3. cnpm install iview -Djava
按需引入iview組件 webpack
cnpm install babel-plugin-import -Dios
定製主題:使用iview3時webpack有個坑web
utils.js中 less: generateLoaders('less', { javascriptEnabled: true }),vuex
4.cnpm i vuex -Dnpm
5.添加 vue-lazyload :圖片預加載axios
main.js 中 添加 緩存
import VueLazyload from 'vue-lazyload'
Vue.use(VueLazyload, {
loading: require('@/common/image/default.png')
})複製代碼
6.全局filter 建目錄components/filters
7.utils 工具包 建目錄components/utils
8. 加載模塊優化 router/index.js
{ path: '/auth/login',
component: (resolve) => {require(['@/components/kams/auth/login'], resolve) },
},複製代碼
9. meta(禁用頁面緩存)
<meta charset="utf-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
複製代碼
11.添加axios cnpm i axios -D,(des,rsa公司加解密標準)
添加http.js等文件