Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

各位大佬, 问下 VueHtml5Editor 为啥初始化报错, #156

Open
luo963827954 opened this issue Apr 13, 2020 · 2 comments
Open

各位大佬, 问下 VueHtml5Editor 为啥初始化报错, #156

luo963827954 opened this issue Apr 13, 2020 · 2 comments

Comments

@luo963827954
Copy link

引入方式
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

--->
at src/App.vue

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

--->
at src/App.vue

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)

@lsmtty
Copy link

lsmtty commented Aug 20, 2020

请问问题结局了吗

@renlixin
Copy link

renlixin commented Dec 3, 2020

因为他走的是运行时,所以需要修改你的cue.config.js
`
module.exports = {
runtimeCompiler: true,
configureWebpack: config => {
config.resolve = {
extensions: [".js", ".vue", ".json", ".css"],
alias: {
vue$: "vue/dist/vue.esm.js",
}
};
}
}

`

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants