vue事件处理--获得触发事件的dom元素

$event是触发事件,它的path属性和composedPath方法都能获得dom树的数组

 

IE11和Edge都不支持pathcomposedPathFirefox支持composedPathChrome支持path(这是Google的原始想法)和composedPath

https://stackoverflow.com/questions/39245488/event-path-is-undefined-running-in-firefox

 

然而以上都没什么卵用

因为我发现currentTarget属性可以直接返回触发的dom元素

posted @ 2021-01-04 10:57  铽楉QAQ  阅读(1061)  评论(0)    收藏  举报