vue 动态设置点击事件 动态设置属性 []

Posted 安果移不动

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue 动态设置点击事件 动态设置属性 []相关的知识,希望对你有一定的参考价值。

 

<script setup lang="ts">
const xxx = () => 
  console.log("我是xxx");
;
const event = "click";
</script>

<template>
  <div>
    <button @[event]="xxx">尽情的点击我</button>
  </div>
</template>

以上是关于vue 动态设置点击事件 动态设置属性 []的主要内容,如果未能解决你的问题,请参考以下文章