Skip to content

Commit

Permalink
Fixed: Avoid mutating a prop directly error message to reproduce
Browse files Browse the repository at this point in the history
  • Loading branch information
HondryTravis committed May 30, 2022
1 parent f019f70 commit 49cd5bf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/vue-2/src/VueRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@ export class VueRenderer {
}

// 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
.entries(props)
.forEach(([key, value]) => {
this.ref.$props[key] = value
})

Vue.config.silent = originalSilent
currentVueConstructor.config.silent = originalSilent
}

destroy(): void {
Expand Down

0 comments on commit 49cd5bf

Please sign in to comment.