修复VFormRender组件用@声明事件处理失效的问题。

This commit is contained in:
vdpAdmin 2022-04-08 11:28:06 +08:00
parent af06777daf
commit 8cdafa4136
2 changed files with 8 additions and 6 deletions

View File

@ -349,16 +349,16 @@
* 获取所有字段组件
* @returns {*[]}
*/
getFieldWidgets() {
return getAllFieldWidgets(this.designer.widgetList)
getFieldWidgets(widgetList = null) {
return !!widgetList ? getAllFieldWidgets(widgetList) : getAllFieldWidgets(this.designer.widgetList)
},
/**
* 获取所有容器组件
* @returns {*[]}
*/
getContainerWidgets() {
return getAllContainerWidgets(this.designer.widgetList)
getContainerWidgets(widgetList = null) {
return !!widgetList ? getAllContainerWidgets(widgetList) : getAllContainerWidgets(this.designer.widgetList)
},
//TODO:

View File

@ -51,7 +51,6 @@ export default {
},
dispatch: function dispatch(componentName, eventName, params) {
//debugger
let parent = this.$parent || this.$root;
let name = parent.$options.componentName;
@ -63,9 +62,12 @@ export default {
}
}
if (parent) {
//parent.$emit.apply(parent, [eventName].concat(params));
if (!!parent.emit$) {
parent.emit$.call(parent, eventName, params)
if (componentName === 'VFormRender') {
parent.$emit(eventName, params) //执行原生$emit以便可以用@进行声明式事件处理!!
}
}
}
},