| | |
| | | <script setup lang="ts">
|
| | | import { reactive } from "vue";
|
| | | import dayjs from 'dayjs';
|
| | | import type {DateDataType} from "./index.d"
|
| | | import {useSettingStore} from "@/stores/index"
|
| | |
|
| | | const dateData = reactive({
|
| | | dateDay: null,
|
| | | dateYear: null,
|
| | | dateWeek: null,
|
| | | weekday: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
|
| | | const dateData = reactive<DateDataType>({
|
| | | dateDay: "",
|
| | | dateYear: "",
|
| | | dateWeek: "",
|
| | | timing:null
|
| | | });
|
| | |
|
| | | const showSetting = () => {};
|
| | | const { setSettingShow} =useSettingStore()
|
| | | const weekday= ["周日", "周一", "周二", "周三", "周四", "周五", "周六"]
|
| | | const timeFn = () => {
|
| | | dateData.timing = setInterval(() => {
|
| | | dateData.dateDay = dayjs().format("YYYY-MM-DD hh : mm : ss");
|
| | | dateData.dateWeek = weekday[dayjs().day()];
|
| | | }, 1000);
|
| | | };
|
| | | timeFn()
|
| | | </script>
|
| | |
|
| | | <template>
|
| | |
| | | </div>
|
| | | <div class="timers">
|
| | | {{ dateData.dateYear }} {{ dateData.dateWeek }} {{ dateData.dateDay }}
|
| | | <i
|
| | | class="blq-icon-shezhi02"
|
| | | style="margin-left: 10px"
|
| | | @click="showSetting"
|
| | | ></i>
|
| | |
|
| | | <div class="setting_icon" @click="setSettingShow(true)">
|
| | | <img src="@/assets/img/headers/setting.png" alt="设置">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </template>
|
| | |
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | .blq-icon-shezhi02 {
|
| | | .setting_icon {
|
| | | width: 20px;
|
| | | height: 20px;
|
| | | cursor: pointer;
|
| | | margin-left: 12px;
|
| | | img{
|
| | | width: 100%;
|
| | | height: 100%;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|