mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-04-06 03:57:49 +08:00
v3.3.6 bug fixed: UnlockScreen组件时间动态刷新bug修复
This commit is contained in:
parent
2a64d07a42
commit
2845796e38
@ -47,6 +47,14 @@ const UnlockScreen = defineComponent({
|
||||
YY_MM_DD: dayjs().format(YY_MM_DD_FORMAT),
|
||||
DDD: dayjs().format(DDD_FORMAT),
|
||||
})
|
||||
const dayInterval = setInterval(() => {
|
||||
state.HH_MM = dayjs().format(HH_MM_FORMAT)
|
||||
state.AM_PM = dayjs().format(AM_PM_FORMAT)
|
||||
}, 6_000)
|
||||
const yearInterval = setInterval(() => {
|
||||
state.YY_MM_DD = dayjs().format(YY_MM_DD_FORMAT)
|
||||
state.DDD = dayjs().format(DDD_FORMAT)
|
||||
}, 86_400_000)
|
||||
|
||||
/** 退出登陆并且回到登陆页 */
|
||||
const backToSignin = () => {
|
||||
@ -78,6 +86,11 @@ const UnlockScreen = defineComponent({
|
||||
|
||||
autoFouceInput(inputInstRef)
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
clearInterval(dayInterval)
|
||||
clearInterval(yearInterval)
|
||||
})
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
backToSignin,
|
||||
|
@ -9,6 +9,12 @@
|
||||
* @remark 今天也是元气满满撸代码的一天
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* 该页面使用了 RayTooltipIcon 组件, 这个组件其实并不合理
|
||||
* 所以在后续的小版本中会舍弃这个组件
|
||||
*/
|
||||
|
||||
import './index.scss'
|
||||
|
||||
import { NLayoutHeader, NSpace, NTooltip, NDropdown } from 'naive-ui'
|
||||
|
@ -36,7 +36,7 @@ export const useSetting = defineStore(
|
||||
breadcrumbSwitch: true, // 面包屑开关
|
||||
localeLanguage: getDefaultLocal(),
|
||||
lockScreenSwitch: false, // 锁屏开关
|
||||
lockScreenInputSwitch: false, // 锁屏输入状态开关
|
||||
lockScreenInputSwitch: false, // 锁屏输入状态开关(预留该字段是为了方便拓展用, 但是舍弃了该字段, 改为使用 useAppLockScreen 方法)
|
||||
})
|
||||
|
||||
/** 修改当前语言 */
|
||||
|
2
src/types/utils.d.ts
vendored
2
src/types/utils.d.ts
vendored
@ -6,7 +6,7 @@ import type { VNodeChild } from 'vue'
|
||||
|
||||
export global {
|
||||
declare interface IUnknownObjectKey {
|
||||
[propName: string]: unknown
|
||||
[propName: string]: any
|
||||
}
|
||||
|
||||
declare type EventListenerOrEventListenerObject =
|
||||
|
Loading…
x
Reference in New Issue
Block a user