src/views/home/index.vue
@@ -5,12 +5,14 @@ import {useRoute} from 'vue-router' const router = useRoute() const counter = useCounterStore() const data={ name:'cheng', age:18 } // counter.count++ const count=computed(()=>{ return counter.count }) console.log(count, 'count') const add=()=>{ counter.increment() } @@ -25,5 +27,6 @@ <Button @click="add" type="primary"> Tertiary{{count}} </Button> <div>{{data.name}}</div> </template>