vue-html5-editor
vue-html5-editor copied to clipboard
各位大佬, 问下 VueHtml5Editor 为啥初始化报错,
引入方式 import VueHtml5Editor from 'vue-html5-editor'; Vue.use(VueHtml5Editor)
组件使用方式 vue-html5-editor :content="content" :height="500"
报错信息
[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.
found in
---> <VueHtml5Editor> <App> at src/App.vue <Root> warn @ vue.runtime.esm.js?2b0e:619 mountComponent @ vue.runtime.esm.js?2b0e:4029 Vue.$mount @ vue.runtime.esm.js?2b0e:8415 init @ vue.runtime.esm.js?2b0e:3118 createComponent @ vue.runtime.esm.js?2b0e:5978 createElm @ vue.runtime.esm.js?2b0e:5925 createChildren @ vue.runtime.esm.js?2b0e:6053 createElm @ vue.runtime.esm.js?2b0e:5954 patch @ vue.runtime.esm.js?2b0e:6477 Vue._update @ vue.runtime.esm.js?2b0e:3945 updateComponent @ vue.runtime.esm.js?2b0e:4066 get @ vue.runtime.esm.js?2b0e:4479 Watcher @ vue.runtime.esm.js?2b0e:4468 mountComponent @ vue.runtime.esm.js?2b0e:4073 Vue.$mount @ vue.runtime.esm.js?2b0e:8415 init @ vue.runtime.esm.js?2b0e:3118 createComponent @ vue.runtime.esm.js?2b0e:5978 createElm @ vue.runtime.esm.js?2b0e:5925 patch @ vue.runtime.esm.js?2b0e:6516 Vue._update @ vue.runtime.esm.js?2b0e:3945 updateComponent @ vue.runtime.esm.js?2b0e:4066 get @ vue.runtime.esm.js?2b0e:4479 Watcher @ vue.runtime.esm.js?2b0e:4468 mountComponent @ vue.runtime.esm.js?2b0e:4073 Vue.$mount @ vue.runtime.esm.js?2b0e:8415 eval @ main.js?56d7:12 ./src/main.js @ app.js:945 webpack_require @ app.js:785 fn @ app.js:151 1 @ app.js:958 webpack_require @ app.js:785 checkDeferredModules @ app.js:46 (anonymous) @ app.js:861 (anonymous) @ app.js:864 Show 4 more frames vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in mounted hook: "TypeError: Cannot set property 'innerHTML' of undefined"
found in
---> <VueHtml5Editor> <App> at src/App.vue <Root> warn @ vue.runtime.esm.js?2b0e:619 logError @ vue.runtime.esm.js?2b0e:1884 globalHandleError @ vue.runtime.esm.js?2b0e:1879 handleError @ vue.runtime.esm.js?2b0e:1839 invokeWithErrorHandling @ vue.runtime.esm.js?2b0e:1862 callHook @ vue.runtime.esm.js?2b0e:4219 insert @ vue.runtime.esm.js?2b0e:3139 invokeInsertHook @ vue.runtime.esm.js?2b0e:6346 patch @ vue.runtime.esm.js?2b0e:6565 Vue._update @ vue.runtime.esm.js?2b0e:3945 updateComponent @ vue.runtime.esm.js?2b0e:4066 get @ vue.runtime.esm.js?2b0e:4479 Watcher @ vue.runtime.esm.js?2b0e:4468 mountComponent @ vue.runtime.esm.js?2b0e:4073 Vue.$mount @ vue.runtime.esm.js?2b0e:8415 eval @ main.js?56d7:12 ./src/main.js @ app.js:945 webpack_require @ app.js:785 fn @ app.js:151 1 @ app.js:958 webpack_require @ app.js:785 checkDeferredModules @ app.js:46 (anonymous) @ app.js:861 (anonymous) @ app.js:864 vue.runtime.esm.js?2b0e:1888 TypeError: Cannot set property 'innerHTML' of undefined at VueComponent.mounted (vue-html5-editor.js?c097:1254) at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854) at callHook (vue.runtime.esm.js?2b0e:4219) at Object.insert (vue.runtime.esm.js?2b0e:3139) at invokeInsertHook (vue.runtime.esm.js?2b0e:6346) at Vue.patch [as patch] (vue.runtime.esm.js?2b0e:6565) at Vue._update (vue.runtime.esm.js?2b0e:3945) at Vue.updateComponent (vue.runtime.esm.js?2b0e:4066) at Watcher.get (vue.runtime.esm.js?2b0e:4479) at new Watcher (vue.runtime.esm.js?2b0e:4468)
请问问题结局了吗
因为他走的是运行时,所以需要修改你的cue.config.js ` module.exports = { runtimeCompiler: true, configureWebpack: config => { config.resolve = { extensions: [".js", ".vue", ".json", ".css"], alias: { vue$: "vue/dist/vue.esm.js", } }; } }
`