_events:用于存放组件内的事件
_hasHookEvent:是否有生命周期钩子的回调函数挂载在当前组件上,eg: @hook:beforeCreated
listeners: v-on 的事件集合
export function initEvents (vm: Component) {
vm._events = Object.create(null)
vm._hasHookEvent = false
// init parent attached events
const listeners = vm.$options._parentListeners
if (listeners) {
updateComponentListeners(vm, listeners)
}
}