From 34257f504330191b1a698eb48b52217095db47fe Mon Sep 17 00:00:00 2001
From: zmc <zmc_li@foxmail.com>
Date: 星期一, 04 九月 2023 18:10:46 +0800
Subject: [PATCH] 扬尘vue

---
 src/views/setting/SetConfiguration.vue |  104 +++++++++++++++++++++++++++++----------------------
 1 files changed, 59 insertions(+), 45 deletions(-)

diff --git a/src/views/setting/SetConfiguration.vue b/src/views/setting/SetConfiguration.vue
index 9adf956..d8d07c5 100644
--- a/src/views/setting/SetConfiguration.vue
+++ b/src/views/setting/SetConfiguration.vue
@@ -1,62 +1,76 @@
 <script>
-// import DustRadarChart from '../../sfc/DustRadarChart.vue';
-import TimeSelectWithShortCuts from '../../sfc/TimeSelectWithShortCuts.vue'
-import dayjs from 'dayjs';
-  export default {
-    components :{
-    // DustRadarChart,
-    // TimeSelectWithShortCuts
-  },
-    data() {
+import {useCounterStore} from '@/stores/counter';
+export default {
+   data(){
       return{
 
       }
-    },
-    mounted() {
+   },
+   setup(){
+    const store = useCounterStore()
+    const unsubscribe = store.$onAction(
+  ({
+    name, // action 鐨勫悕瀛�
+    store, // store 瀹炰緥
+    args, // 璋冪敤杩欎釜 action 鐨勫弬鏁�
+    after, // 鍦ㄨ繖涓� action 鎵ц瀹屾瘯涔嬪悗锛屾墽琛岃繖涓嚱鏁�
+    onError, // 鍦ㄨ繖涓� action 鎶涘嚭寮傚父鐨勬椂鍊欙紝鎵ц杩欎釜鍑芥暟
+  }) => {
+    // 璁板綍寮�濮嬬殑鏃堕棿鍙橀噺
+    const startTime = Date.now()
+    // 杩欏皢鍦� `store` 涓婄殑鎿嶄綔鎵ц涔嬪墠瑙﹀彂
+    console.log(`Start "${name}" with params [${args.join(', ')}].`)
 
+    // 濡傛灉 action 鎴愬姛骞朵笖瀹屽叏杩愯鍚庯紝after 灏嗚Е鍙戙��
+    // 瀹冨皢绛夊緟浠讳綍杩斿洖鐨� promise
+    after((result) => { 
+      console.log(
+        `Finished "${name}" after ${
+          Date.now() - startTime
+        }ms.\nResult: ${result}.`
+      )
+    })
+
+    // 濡傛灉 action 鎶涘嚭鎴栬繑鍥� Promise.reject 锛宱nError 灏嗚Е鍙�
+    onError((error) => {
+      console.warn(
+        `Failed "${name}" after ${Date.now() - startTime}ms.\nError: ${error}.`
+      )
+    })
+  }
+)
+    return{
+      store,unsubscribe
+    }
+   },
+   computed:{
+    a(){
+      return this.store.doubleCount*2
     },
-    methods: {
  
-     }
+   },
+   mounted(){
+
+   },
+   methods:{
+    doThing(){
+      this.store.increment(5)
+      this.store.doubleCount
+    }
+   }
 }
 </script>
 
 <template>
   <div>
-    <DustRadarChart></DustRadarChart>
+    <el-button type="primary" @click="doThing">鐐瑰嚮{{ store.doubleCount }}</el-button>
   </div>
-
-  <!-- <div class="container">
-    <el-space wrap :size="20" >
-      <el-card v-for="i in 6" :key="i">
-        111
-      </el-card>
-    </el-space>
-    <el-card v-for="i in 5" :key="i">
-        111
-    </el-card>
-    <el-card>
-      22
-    </el-card>
-
-  </div> -->
+  <div>{{ a }}</div>
+  <div>{{ store.secret }}</div>
+  <div>{{ store.vue }}</div>
+  <div>{{ store.澶� }}</div>
 
 </template>
+<style scoped>
 
-<style  scoped>
-
-.container {
-  margin: 20px 20px;
-  display: flex;
-  flex-flow: row wrap;
-  gap: 20px;
-  height: 100%;
-}
-.el-card {
- min-width: 500px;
-  min-height: 400px;
-  flex: 1 200px;
-  /* flex: 1; */
- 
-}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3