如图,在引用pinia时出现了如下问题,。,有没有什么解决方式??
【相关推荐】
<template>
<section class="a">
<div>appCount - {{ appCount }}</div>
<div>homeStr - {{ homeStr }}</div>
<el-button type="primary" @click="btn">Primary</el-button>
</section>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import useStore from '@/store'
const { app, home } = useStore() as any // 拿到 store的数据
const appCount = computed(() => app.count)
const homeStr = computed(() => home.homeStr)
const btn = () => {
app.addCount(10)
home.changeHomeStr("我是hh")
}
</script>
<style></style>