Nelze vybrat více než 25 témat
Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
30 lines
516 B
30 lines
516 B
<template>
|
|
<div>{{ name }} -- {{ showCount }}</div>
|
|
<button @click="addBtn">addBtn</button>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
import {ref, computed} from 'vue'
|
|
import {useStore} from '@/store/index'
|
|
|
|
const store = useStore()
|
|
const showCount = computed(() => {
|
|
return store.getters.getNum
|
|
})
|
|
const count = ref(showCount.value)
|
|
|
|
const name = ref('this is about')
|
|
|
|
const addBtn = () => {
|
|
store.commit('setNum', ++count.value)
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
button{
|
|
margin-top: 10px;
|
|
}
|
|
</style>
|