Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d884f71d
authored
Feb 29, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
2023-06-25:perf: 优化锁屏组件
parent
f8580fdf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
62 deletions
+2
-62
src/components/Editor/src/Editor.vue
+1
-1
src/layout/components/UserInfo/src/components/LockPage.vue
+1
-1
src/layout/components/UserInfo/src/components/useNow.ts
+0
-60
No files found.
src/components/Editor/src/Editor.vue
View file @
d884f71d
...
@@ -180,7 +180,7 @@ defineExpose({
...
@@ -180,7 +180,7 @@ defineExpose({
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"
z-99 border-1 border-[var(--el-border-color)] border-solid
"
>
<div
class=
"
border-1 border-solid border-[var(--tags-view-border-color)] z-10
"
>
<!-- 工具栏 -->
<!-- 工具栏 -->
<Toolbar
<Toolbar
:editor=
"editorRef"
:editor=
"editorRef"
...
...
src/layout/components/UserInfo/src/components/LockPage.vue
View file @
d884f71d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
{
resetRouter
}
from
'@/router'
import
{
resetRouter
}
from
'@/router'
import
{
useCache
}
from
'@/hooks/web/useCache'
import
{
useCache
}
from
'@/hooks/web/useCache'
import
{
useLockStore
}
from
'@/store/modules/lock'
import
{
useLockStore
}
from
'@/store/modules/lock'
import
{
useNow
}
from
'
.
/useNow'
import
{
useNow
}
from
'
@/hooks/web
/useNow'
import
{
useDesign
}
from
'@/hooks/web/useDesign'
import
{
useDesign
}
from
'@/hooks/web/useDesign'
import
{
useTagsViewStore
}
from
'@/store/modules/tagsView'
import
{
useTagsViewStore
}
from
'@/store/modules/tagsView'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useUserStore
}
from
'@/store/modules/user'
...
...
src/layout/components/UserInfo/src/components/useNow.ts
deleted
100644 → 0
View file @
f8580fdf
import
{
dateUtil
}
from
'@/utils/dateUtil'
import
{
reactive
,
toRefs
}
from
'vue'
import
{
tryOnMounted
,
tryOnUnmounted
}
from
'@vueuse/core'
export
function
useNow
(
immediate
=
true
)
{
let
timer
:
IntervalHandle
const
state
=
reactive
({
year
:
0
,
month
:
0
,
week
:
''
,
day
:
0
,
hour
:
''
,
minute
:
''
,
second
:
0
,
meridiem
:
''
})
const
update
=
()
=>
{
const
now
=
dateUtil
()
const
h
=
now
.
format
(
'HH'
)
const
m
=
now
.
format
(
'mm'
)
const
s
=
now
.
get
(
's'
)
state
.
year
=
now
.
get
(
'y'
)
state
.
month
=
now
.
get
(
'M'
)
+
1
state
.
week
=
'星期'
+
[
'日'
,
'一'
,
'二'
,
'三'
,
'四'
,
'五'
,
'六'
][
now
.
day
()]
state
.
day
=
now
.
get
(
'date'
)
state
.
hour
=
h
state
.
minute
=
m
state
.
second
=
s
state
.
meridiem
=
now
.
format
(
'A'
)
}
function
start
()
{
update
()
clearInterval
(
timer
)
timer
=
setInterval
(()
=>
update
(),
1000
)
}
function
stop
()
{
clearInterval
(
timer
)
}
tryOnMounted
(()
=>
{
immediate
&&
start
()
})
tryOnUnmounted
(()
=>
{
stop
()
})
return
{
...
toRefs
(
state
),
start
,
stop
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment