From 14e73128bfa02922fdcf9591ee6d5fd6b6f7a5c6 Mon Sep 17 00:00:00 2001
From: Mr.Zhang <710666463@qq.com>
Date: 星期二, 22 八月 2023 10:25:26 +0800
Subject: [PATCH] 不良品饼图
---
screen_standard/src/stores/counter.js | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/screen_standard/src/stores/counter.js b/screen_standard/src/stores/counter.js
index b6757ba..42f01ba 100644
--- a/screen_standard/src/stores/counter.js
+++ b/screen_standard/src/stores/counter.js
@@ -1,12 +1,15 @@
-import { ref, computed } from 'vue'
-import { defineStore } from 'pinia'
+import { computed } from 'vue';
+import { defineStore } from 'pinia';
-export const useCounterStore = defineStore('counter', () => {
- const count = ref(0)
- const doubleCount = computed(() => count.value * 2)
- function increment() {
- count.value++
+export const useCounterStore = defineStore('enterprise', {
+ state: () => {
+ return { count: 0 }
+ },
+ // 涔熷彲浠ュ畾涔変负
+ // state: () => ({ count: 0 })
+ actions: {
+ increment() {
+ this.count++
+ },
}
-
- return { count, doubleCount, increment }
})
--
Gitblit v1.9.3