"[Vue warn]: Failed to mount component: template or render function not defined"错误的解决

VUE中动态路由出错:

复制代码
vue.esm.js?a026:591 [Vue warn]: Failed to mount component: template or render function not defined.

found in

---> <Anonymous>
       <ElCard>
         <ElTabPane>
           <ElTabs>
             <MainContent> at src\components\admin\MainContent.vue
               <Main> at src\components\admin\Main.vue
                 <App> at src\pages\admin\index\app.vue
                   <Root>
复制代码

找到原因如下:

https://stackoverflow.com/questions/45964665/vuejs-failed-to-mount-component

//https://stackoverflow.com/questions/45964665/vuejs-failed-to-mount-component

You might be running into the breaking change described here: https://github.com/vuejs/vue-loader/releases/tag/v13.0.0

Try adding .default to the end of your require().

component: require('./index/index.vue').default

 

posted @   万里沙来手一挥  阅读(25964)  评论(2编辑  收藏  举报
编辑推荐:
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
阅读排行:
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
· 上周热点回顾(2.17-2.23)
点击右上角即可分享
微信分享提示