綁定函數無參數 - event對象作為默認作為參數傳遞
<template><div class="hello" @click="e_Click"></div>
</template>
<script>export default {methods: {e_Click(evt) {console.log(evt);}}
</script>
綁定函數有其它參數 - 使用$event傳遞
<template><div class="hello" @click="e_Click('hello組件',$event)"></div>
</template><script>export default {methods: {e_Click(value,event) {console.log(value,event);}}
</script>
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态