Skip to content

自定义dispatch,如何触发form 表单change事件 #3658

@anihCevol

Description

@anihCevol
  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

是否支持 this.dispatch('ElFormItem', 'el.form.change') ,ant中如何触发表单的change事件

What does the proposed API look like?

dispatch(componentName, eventName, params) {
let parent = this.$parent || this.$root
let name = parent.$options.name
while (parent && (!name || name !== componentName)) {
parent = parent.$parent
if (parent) {
name = parent.$options.name
}
}
console.log(parent.$options.name)
console.log(parent)
if (parent) {
parent.$emit.apply(parent, [eventName].concat(params))
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions