Closed liujun8892 closed 3 years ago
拉v3版本的代码可以
我也遇到这个问题了,修改src/permission.js文件,把38到40行修改为router.addRoutes(store.getters.addRouters)
,就可以了。估计是vue-router版本问题,build出来的版本无法使用vue-router新的addRoute方法,改成老的addRoutes就行了。我也是前端小白,希望开发者能找下原因。参考:https://router.vuejs.org/zh/api/#router-addroutes
Question (问题描述) 本地服务正常: 打成预览模式的包, 就会报addRoute不是一个方法
Describe the solution you'd like (你期待的是什么?) 期待在预览模式下也能登录然后进入面板页 A clear and concise description of what you want to happen.
Additional context(附加信息) 拉的master代码, 使用的yarn install 和 yarn run build:preview 然后部署在宝塔. 不管是在宝塔linux服务器, 还是用 serve -s 运行都会报y.addRoute is not a function 公网预览地址: http://antdpro.liujun1314.online/ Add any other context or screenshots about the feature request here.