vue 組件使用template 選項 報錯


報錯信息:

vue.runtime.esm.js?2b0e:619 [Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.

image-20201117153015248

解決辦法:

新建vue.config.js

// vue.config.js
module.exports = {

    runtimeCompiler: true,
}

重啟server並重新刷新頁面

相關解釋:

https://cli.vuejs.org/zh/config/#runtimecompiler


免責聲明!

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



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