<script lang="ts" setup>
|
import { onMounted,computed } from 'vue'
|
import { useCounterStore } from '@/stores/counter'
|
import { Button } from 'vant'
|
import {useRoute} from 'vue-router'
|
const router = useRoute()
|
const counter = useCounterStore()
|
|
// counter.count++
|
const count=computed(()=>{
|
return counter.count
|
})
|
console.log(count, 'count')
|
const add=()=>{
|
counter.increment()
|
}
|
onMounted(() => {
|
console.log('初始化')
|
console.log(router.query)
|
})
|
|
</script>
|
|
<template>
|
<Button @click="add" type="primary">
|
Tertiary{{count}}
|
</Button>
|
</template>
|