mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-15 09:21:25 +08:00
23 lines
626 B
JavaScript
23 lines
626 B
JavaScript
export default {
|
||
methods: {
|
||
setState (state, callback) {
|
||
Object.assign(this.$data, state)
|
||
this.$nextTick(() => {
|
||
callback && callback()
|
||
})
|
||
},
|
||
__emit () { // 直接调用listeners,底层组件不需要vueTool记录events
|
||
const args = [].slice.call(arguments, 0)
|
||
const filterEvent = []
|
||
const eventName = args[0]
|
||
if (args.length && this.$listeners[eventName]) {
|
||
if (filterEvent.includes(eventName)) {
|
||
this.$emit(eventName, ...args.slice(1))
|
||
} else {
|
||
this.$listeners[eventName](...args.slice(1))
|
||
}
|
||
}
|
||
},
|
||
},
|
||
}
|