Commit 7afbd71df765b90f38ca0c570718287c5183bf5f
1 parent
4a7ae570
chore(editor): #3 add props of plugin to element.pluginProps, not element
Showing
1 changed file
with
3 additions
and
2 deletions
front-end/h5/src/views/Editor.vue
| @@ -303,6 +303,7 @@ class Element { | @@ -303,6 +303,7 @@ class Element { | ||
| 303 | }) | 303 | }) |
| 304 | 304 | ||
| 305 | // init prop of plugin | 305 | // init prop of plugin |
| 306 | + this.pluginProps = {} | ||
| 306 | const propConf = this.editorConfig.propsConfig | 307 | const propConf = this.editorConfig.propsConfig |
| 307 | Object.keys(propConf).forEach(key => { | 308 | Object.keys(propConf).forEach(key => { |
| 308 | // #6 | 309 | // #6 |
| @@ -310,7 +311,7 @@ class Element { | @@ -310,7 +311,7 @@ class Element { | ||
| 310 | console.warn('Please do not use {name} as plugin prop') | 311 | console.warn('Please do not use {name} as plugin prop') |
| 311 | return | 312 | return |
| 312 | } | 313 | } |
| 313 | - this[key] = propConf[key].defaultPropValue | 314 | + this.pluginProps[key] = propConf[key].defaultPropValue |
| 314 | }) | 315 | }) |
| 315 | } | 316 | } |
| 316 | 317 | ||
| @@ -384,7 +385,7 @@ const Editor = { | @@ -384,7 +385,7 @@ const Editor = { | ||
| 384 | return (() => { | 385 | return (() => { |
| 385 | const data = { | 386 | const data = { |
| 386 | style: element.getStyle(), | 387 | style: element.getStyle(), |
| 387 | - props: element, // #6 | 388 | + props: element.pluginProps, // #6 #3 |
| 388 | nativeOn: { | 389 | nativeOn: { |
| 389 | click: this.setCurrentEditingElement.bind(this, element) | 390 | click: this.setCurrentEditingElement.bind(this, element) |
| 390 | } | 391 | } |