vue 中 @click.native.prevent 事件

mac2022-06-30  24

在项目中看到@click.native.prevent, 查了一点资料 总结一下,

 

 

1.给vue组件绑定事件时候,必须加上native ,否则会认为监听的是来自Item组件自定义的事件,

2.prevent 是用来阻止默认的 ,相当于原生的event.preventDefault()

 

转载于:https://www.cnblogs.com/jayjay798/p/11471220.html

最新回复(0)