使用 v-on 指令监听 DOM 事件
<button v-on:click="increment">{{ count }}</button>
简写语法
<button @click="increment">{{ count }}</button>
<script setup>
import { ref } from 'vue'
const count = ref(0)
function increment() {
count.value += 1
}
</script>
<template>
<!-- 使此按钮生效 -->
<button @click = "increment">count is: {{ count }}</button>
</template>
标签:count,学习,vue,003,ref,监听
From: https://www.cnblogs.com/ayubene/p/18042935