diff --git a/components/_util/BaseMixin.js b/components/_util/BaseMixin.js index 037d5e05f..1bf7c9c3c 100644 --- a/components/_util/BaseMixin.js +++ b/components/_util/BaseMixin.js @@ -1,5 +1,4 @@ import { getOptionProps } from './props-util'; -import { isOn } from './util'; export default { methods: { @@ -25,13 +24,10 @@ export default { }); }, __emit() { - // 直接调用listeners,底层组件不需要vueTool记录events + // 直接调用事件,底层组件不需要vueTool记录events const args = [].slice.call(arguments, 0); let eventName = args[0]; - // TODO: 后续统一改成onXxxx,不在运行时转,提升性能 - eventName = isOn(eventName) - ? eventName - : `on${eventName[0].toUpperCase()}${eventName.substring(1)}`; + eventName = `on${eventName[0].toUpperCase()}${eventName.substring(1)}`; const event = this.$props[eventName] || this.$attrs[eventName]; if (args.length && event) { if (Array.isArray(event)) { diff --git a/components/vc-trigger/Trigger.jsx b/components/vc-trigger/Trigger.jsx index 3700fcaaa..e3eb6bdff 100644 --- a/components/vc-trigger/Trigger.jsx +++ b/components/vc-trigger/Trigger.jsx @@ -568,7 +568,10 @@ export default { if (this.childOriginEvents[type]) { this.childOriginEvents[type](e); } - this.__emit(type, e); + const event = this.$props[type] || this.$attrs[type]; + if (event) { + event(e); + } }, close() {