收藏
回答

如何动态注册事件?

<view v-on:[eventName]="handleEvnet">测试</view>


eventName:‘click’,

eventType: {

click: this.handleClick,

dblclick: this.handleDbclick

}


编译小程序报错:

15:13:15.688 [plugin:commonjs] [plugin vite:vue] ../../../../../E:/ay-projects/platform/m/pages/prefix.vue (5:9): v-on:[event]="" is not supported.




vue官网示例

<!-- 动态事件 -->

<button v-on:[event]="doThis"></button>

回答关注问题邀请回答
收藏
登录 后发表内容