Commit 9e8e89f 1 parent 28a0310 commit 9e8e89f Copy full SHA for 9e8e89f
File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,12 @@ const LbpButton = {
203
203
}),
204
204
computed: {
205
205
value_: {
206
- get : () => this .value ,
206
+ // TODO 关于箭头函数中的this:这里不能写成箭头函数,否则 this 为 undefined,为何?
207
+ // http://davidshariff.com/blog/what-is-the-execution-context-in-javascript/
208
+ // https://tangxiaolang101.github.io/2016/08/01/%E6%B7%B1%E5%85%A5%E6%8E%A2%E8%AE%A8JavaScript%E7%9A%84%E6%89%A7%E8%A1%8C%E7%8E%AF%E5%A2%83%E5%92%8C%E6%A0%88%EF%BC%88What%20is%20the%20Execution%20Context%20&%20Stack%20in%20JavaScript%EF%BC%89/
209
+ get () {
210
+ return this .value
211
+ },
207
212
set (val) {
208
213
this .$emit (' input' , val)
209
214
}
@@ -350,8 +355,16 @@ const Editor = {
350
355
const editorConfig = this .getEditorConfig (name)
351
356
this .elements .push (new Element ({ name, zindex, editorConfig }))
352
357
},
358
+ mixinPluginCustomComponents2Editor () {
359
+ const { components } = this .editingElement .editorConfig
360
+ for (const key in components) {
361
+ if (this .$options .components [key]) return
362
+ this .$options .components [key] = components[key]
363
+ }
364
+ },
353
365
setCurrentEditingElement (element ) {
354
366
this .editingElement = element
367
+ this .mixinPluginCustomComponents2Editor ()
355
368
},
356
369
/**
357
370
* #!zh: renderCanvas 渲染中间画布
You can’t perform that action at this time.
0 commit comments