html
<script setup>
import{ref}from 'vue'
let counter=ref(10)
function increase(){
counter.value++
}
function decrease(){
counter.value--
}
</script>
<template>
<button @click="increase">+</button>
<p id="id1">{{counter}}</p>
<button @click="decrease">-</button>
</template>
<style scoped>
#id1{
color: aqua;
font-size: 40px;
}
</style>
效果图↓