Is the event binding of vue bound to the html element itself?


        Click Me
    </li>
</ul>
The click of

vue should not be bound to the li element, so which element does the event of li bind to? Is it bound to document like react?

Jun.25,2021

https://defed.github.io/Vue%E.

/* @flow */

import { warn } from 'core/util/index'

export default function on (el: ASTElement, dir: ASTDirective) {
  if (process.env.NODE_ENV !== 'production' && dir.modifiers) {
    warn(`v-on without argument does not support modifiers.`)
  }
  el.wrapListeners = (code: string) => `_g(${code},${dir.value})`
}

the source code is like this. It should be bound to the current node and passed into an element

.

Source address: https://github.com/vuejs/vue/.

I hope it will be useful to you

that's right.


is not bound to the element itself, just like react. I'm not sure whether to bind to the document or the root element, but it's just an event delegate

.
Menu