Fixed: Avoid mutating a prop directly error message to reproduce (#2834)

This commit is contained in:
travis 2022-06-06 23:33:13 +08:00 committed by GitHub
parent 807b4ba4e0
commit d85444c310
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,9 +20,11 @@ export class VueRenderer {
} }
// prevents `Avoid mutating a prop directly` error message // prevents `Avoid mutating a prop directly` error message
const originalSilent = Vue.config.silent // Fix: `VueNodeViewRenderer` change vue Constructor `config.silent` not working
const currentVueConstructor = this.ref.$props.editor.contentComponent?.$options._base ?? Vue;
const originalSilent = currentVueConstructor.config.silent
Vue.config.silent = true currentVueConstructor.config.silent = true
Object Object
.entries(props) .entries(props)
@ -30,7 +32,7 @@ export class VueRenderer {
this.ref.$props[key] = value this.ref.$props[key] = value
}) })
Vue.config.silent = originalSilent currentVueConstructor.config.silent = originalSilent
} }
destroy(): void { destroy(): void {