<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++
}
</script>
<template>
<!-- 使此按钮生效 -->
<button @click="increment">Count is: {{ count }}</button>
</template>课程目录