Blogger Information
Blog 28
fans 0
comment 0
visits 65362
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
vue 打包后,放到tp5框架中总是报错Uncaught TypeError: Cannot redefine property: $router
蒸蒸
Original
1225 people have browsed it

在vue中并没有重复声明路由,也没有重名的路由,最后发现是tp5后端的meta中引入了vue、element ui导致的问题
把下面几句代码注释掉之后,问题就解决了:

  1. <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  2. <script src="https://unpkg.com/vue/dist/vue.js"></script>
  3. <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  4. <script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post