"[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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM