使用Pinia代替Vuex进行数据存储

This commit is contained in:
不做码农
2022-06-11 10:33:49 +08:00
parent ef604d008d
commit 859f8acfe2
41 changed files with 700 additions and 797 deletions
+2 -1
View File
@@ -49,13 +49,14 @@
<script setup>
import { CountUp } from 'countup.js'
import useSocketStore from '@/store/modules/socket';
const emit = defineEmits()
const { proxy } = getCurrentInstance()
const state = reactive({
chatNum: 1390,
onlineNum: computed(() => {
return proxy.$store.getters.onlineUserNum
return useSocketStore().onlineNum
}),
amount: 99998,
order: 1999,