mirror of
https://github.com/vform666/variant-form3-vite.git
synced 2025-01-26 16:09:12 +08:00
修复VFormRender组件用@声明事件处理失效的问题。
This commit is contained in:
parent
af06777daf
commit
8cdafa4136
@ -349,16 +349,16 @@
|
|||||||
* 获取所有字段组件
|
* 获取所有字段组件
|
||||||
* @returns {*[]}
|
* @returns {*[]}
|
||||||
*/
|
*/
|
||||||
getFieldWidgets() {
|
getFieldWidgets(widgetList = null) {
|
||||||
return getAllFieldWidgets(this.designer.widgetList)
|
return !!widgetList ? getAllFieldWidgets(widgetList) : getAllFieldWidgets(this.designer.widgetList)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有容器组件
|
* 获取所有容器组件
|
||||||
* @returns {*[]}
|
* @returns {*[]}
|
||||||
*/
|
*/
|
||||||
getContainerWidgets() {
|
getContainerWidgets(widgetList = null) {
|
||||||
return getAllContainerWidgets(this.designer.widgetList)
|
return !!widgetList ? getAllContainerWidgets(widgetList) : getAllContainerWidgets(this.designer.widgetList)
|
||||||
},
|
},
|
||||||
|
|
||||||
//TODO: 增加更多方法!!
|
//TODO: 增加更多方法!!
|
||||||
|
@ -51,7 +51,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
dispatch: function dispatch(componentName, eventName, params) {
|
dispatch: function dispatch(componentName, eventName, params) {
|
||||||
//debugger
|
|
||||||
let parent = this.$parent || this.$root;
|
let parent = this.$parent || this.$root;
|
||||||
let name = parent.$options.componentName;
|
let name = parent.$options.componentName;
|
||||||
|
|
||||||
@ -63,9 +62,12 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (parent) {
|
if (parent) {
|
||||||
//parent.$emit.apply(parent, [eventName].concat(params));
|
|
||||||
if (!!parent.emit$) {
|
if (!!parent.emit$) {
|
||||||
parent.emit$.call(parent, eventName, params)
|
parent.emit$.call(parent, eventName, params)
|
||||||
|
|
||||||
|
if (componentName === 'VFormRender') {
|
||||||
|
parent.$emit(eventName, params) //执行原生$emit,以便可以用@进行声明式事件处理!!
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user