vue中的v-on指令怎么让里面的函数获取到event
在 Vue 中,可以通过 $event 来获取事件对象。例如:
<button v-on:click="handleClick($event)">点击我</button>
在 handleClick 函数中可以通过参数来获取事件对象:
methods: {
handleClick(event) {
console.log(event)
}
}
原文地址: https://www.cveoy.top/t/topic/hlUe 著作权归作者所有。请勿转载和采集!