| 123456789101112131415161718 |
- import { getProductShoppingCartCount } from '@/api/goods/index';
- export const cartStore = defineStore('cart', () => {
- const cartCount = ref<any>(0);
- const onCartCount = () => {
- getProductShoppingCartCount({}).then((res) => {
- if (res.code == 200) {
- cartCount.value = res.data;
- }
- });
- };
- return {
- cartCount,
- onCartCount
- };
- });
|