From 959032b71f4b4fd5e3435fcf1405f1ccaa7f8423 Mon Sep 17 00:00:00 2001
From: 刘嘉威 <daidaibg@163.com>
Date: 星期五, 21 十月 2022 16:45:54 +0800
Subject: [PATCH] feat: 增加左上角图表 优化整体框架

---
 src/views/header.vue |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/views/header.vue b/src/views/header.vue
index 8ffc87f..aba80ff 100644
--- a/src/views/header.vue
+++ b/src/views/header.vue
@@ -1,13 +1,22 @@
 <script setup lang="ts">
 import { reactive } from "vue";
-
-const dateData = reactive({
-  dateDay: null,
-  dateYear: null,
-  dateWeek: null,
-  weekday: ["鍛ㄦ棩", "鍛ㄤ竴", "鍛ㄤ簩", "鍛ㄤ笁", "鍛ㄥ洓", "鍛ㄤ簲", "鍛ㄥ叚"],
+import dayjs from 'dayjs';
+import type {DateDataType} from "./index.d"
+const dateData = reactive<DateDataType>({
+  dateDay: "",
+  dateYear: "",
+  dateWeek: "",
+  timing:null
 });
-
+  
+const weekday= ["鍛ㄦ棩", "鍛ㄤ竴", "鍛ㄤ簩", "鍛ㄤ笁", "鍛ㄥ洓", "鍛ㄤ簲", "鍛ㄥ叚"]
+const timeFn = () => {
+  dateData.timing = setInterval(() => {
+    dateData.dateDay = dayjs().format("YYYY-MM-DD hh : mm : ss");
+    dateData.dateWeek = weekday[dayjs().day()];
+  }, 1000);
+};
+timeFn()
 const showSetting = () => {};
 </script>
 

--
Gitblit v1.8.0