You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
516 B

2 years ago
<template>
2 years ago
<div>{{ name }} -- {{ showCount }}</div>
<button @click="addBtn">addBtn</button>
2 years ago
</template>
<script setup lang="ts">
2 years ago
import {ref, computed} from 'vue'
2 years ago
import {useStore} from '@/store/index'
2 years ago
const store = useStore()
const showCount = computed(() => {
return store.getters.getNum
})
const count = ref(showCount.value)
2 years ago
const name = ref('this is about')
2 years ago
const addBtn = () => {
store.commit('setNum', ++count.value)
}
2 years ago
</script>
2 years ago
<style scoped lang="scss">
button{
margin-top: 10px;
}
2 years ago
</style>