mirror of
				https://github.com/vform666/variant-form3-vite.git
				synced 2025-10-31 16:51:49 +08:00 
			
		
		
		
	修复VFormRender组件用@声明事件处理失效的问题。
This commit is contained in:
		| @@ -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: 增加更多方法!! | ||||
|   | ||||
| @@ -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,以便可以用@进行声明式事件处理!! | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user