Browse Source

更新部分依赖,修复路由懒加载问题

master
xwb 5 years ago
parent
commit
b7ca4415c9
  1. 18
      package.json
  2. 6
      src/router/routers.js
  3. 2
      src/store/modules/permission.js

18
package.json

@ -61,30 +61,34 @@
"vue-splitpane": "1.0.4", "vue-splitpane": "1.0.4",
"vuex": "3.1.0", "vuex": "3.1.0",
"wangeditor": ">=3.0.0", "wangeditor": ">=3.0.0",
"xlsx": "^0.11.16" "xlsx": "^0.11.16",
"js-beautify": "^1.10.2",
"sortablejs": "1.8.4",
"vuedraggable": "2.20.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "7.0.0", "@babel/core": "7.0.0",
"@babel/register": "7.0.0", "@babel/register": "7.0.0",
"@babel/parser": "^7.7.4",
"@vue/cli-plugin-babel": "3.5.3", "@vue/cli-plugin-babel": "3.5.3",
"@vue/cli-plugin-eslint": "3.5.1", "@vue/cli-plugin-eslint": "^3.9.1",
"@vue/cli-plugin-unit-jest": "3.5.3", "@vue/cli-plugin-unit-jest": "3.5.3",
"@vue/cli-service": "3.5.3", "@vue/cli-service": "3.5.3",
"@vue/test-utils": "1.0.0-beta.29", "@vue/test-utils": "1.0.0-beta.29",
"autoprefixer": "^9.5.1", "autoprefixer": "^9.5.1",
"babel-core": "7.0.0-bridge.0", "babel-core": "7.0.0-bridge.0",
"babel-eslint": "8.2.6", "babel-eslint": "10.0.1",
"babel-jest": "23.6.0", "babel-jest": "23.6.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"chalk": "2.4.2", "chalk": "2.4.2",
"chokidar": "2.1.5", "chokidar": "2.1.5",
"connect": "3.6.6", "connect": "3.6.6",
"eslint": "5.15.3", "eslint": "5.15.3",
"eslint-plugin-vue": "5.2.2", "eslint-plugin-vue": "5.2.2",
"html-webpack-plugin": "3.2.0", "html-webpack-plugin": "3.2.0",
"http-proxy-middleware": "^0.19.1",
"husky": "1.3.1", "husky": "1.3.1",
"lint-staged": "8.1.5", "lint-staged": "8.1.5",
"node-sass": "^4.13.0", "node-sass": "^4.9.0",
"plop": "2.3.0", "plop": "2.3.0",
"runjs": "^4.3.2", "runjs": "^4.3.2",
"sass-loader": "^7.1.0", "sass-loader": "^7.1.0",
@ -93,7 +97,9 @@
"serve-static": "^1.13.2", "serve-static": "^1.13.2",
"svg-sprite-loader": "4.1.3", "svg-sprite-loader": "4.1.3",
"svgo": "1.2.0", "svgo": "1.2.0",
"vue-template-compiler": "2.6.10" "vue-template-compiler": "2.6.10",
"babel-plugin-transform-remove-console": "^6.9.4",
"babel-plugin-dynamic-import-node": "2.3.0"
}, },
"engines": { "engines": {
"node": ">=8.9", "node": ">=8.9",

6
src/router/routers.js

@ -7,17 +7,17 @@ Vue.use(Router)
export const constantRouterMap = [ export const constantRouterMap = [
{ path: '/login', { path: '/login',
meta: { title: '登录', noCache: true }, meta: { title: '登录', noCache: true },
component: () => import('@/views/login'), component: (resolve) => require(['@/views/login'], resolve),
hidden: true hidden: true
}, },
{ {
path: '/404', path: '/404',
component: () => import('@/views/features/404'), component: (resolve) => require(['@/views/features/404'], resolve),
hidden: true hidden: true
}, },
{ {
path: '/401', path: '/401',
component: () => import('@/views/features/401'), component: (resolve) => require(['@/views/features/401'], resolve),
hidden: true hidden: true
}, },
{ {

2
src/store/modules/permission.js

@ -37,7 +37,7 @@ export const filterAsyncRouter = (routers) => { // 遍历后台传来的路由
} }
export const loadView = (view) => { export const loadView = (view) => {
return () => import(`@/views/${view}`) return (resolve) => require([`@/views/${view}`], resolve)
} }
export default permission export default permission

Loading…
Cancel
Save