Cannot assign to read only property 'exports' of object '

vue中的router模块会报错Uncaught TypeError: Cannot assign to read only property ‘exports’ of object ‘#<Object>’

这是因为不许混用import和module.exports,

解决办法是改为 ,即

《Cannot assign to read only property 'exports' of object '》

改为

《Cannot assign to read only property 'exports' of object '》

但是改了以后还会报错 “path” is required in a route configuration
这是因为有重复的path,在router.js中进行修改

《Cannot assign to read only property 'exports' of object '》

改为重定向的,就不会和原有的/home下的模块重复

还有必须改为routes.concat(file.default),因为在用module.exports时是routes.concat(file)

    原文作者:小鱼儿
    原文地址: https://segmentfault.com/a/1190000019400099
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞