按官方文档写法,获取store时需要将useStore放入reactive中
<script setup lang="ts" >
import { useStore } from "vuex";
import { key } from '@/store'
import { ref, reactive } from "vue";
const store = reactive(useStore(key))
console.log(store.state.count);
// console.log(store.state.count)
</script>