Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dima Krasner
Sharkey
Commits
c4830dcf
Commit
c4830dcf
authored
2 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
perf(client): use shallowRef as possible
parent
cb35ace0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/client/src/components/analog-clock.vue
+5
-4
5 additions, 4 deletions
packages/client/src/components/analog-clock.vue
packages/client/src/components/global/time.vue
+1
-1
1 addition, 1 deletion
packages/client/src/components/global/time.vue
with
6 additions
and
5 deletions
packages/client/src/components/analog-clock.vue
+
5
−
4
View file @
c4830dcf
...
...
@@ -59,7 +59,7 @@
</template>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
onMounted
,
onBeforeUnmount
}
from
'
vue
'
;
import
{
ref
,
computed
,
onMounted
,
onBeforeUnmount
,
shallowRef
}
from
'
vue
'
;
import
tinycolor
from
'
tinycolor2
'
;
import
{
globalEvents
}
from
'
@/events.js
'
;
...
...
@@ -112,7 +112,7 @@ const texts = computed(() => {
return
angles
;
});
const
now
=
r
ef
(
new
Date
());
const
now
=
shallowR
ef
(
new
Date
());
now
.
value
.
setMinutes
(
now
.
value
.
getMinutes
()
+
(
new
Date
().
getTimezoneOffset
()
+
props
.
offset
));
const
enabled
=
ref
(
true
);
...
...
@@ -130,8 +130,9 @@ const mAngle = computed(() => Math.PI * (m.value + s.value / 60) / 30);
const
sAngle
=
computed
(()
=>
Math
.
PI
*
s
.
value
/
30
);
function
tick
()
{
now
.
value
=
new
Date
();
now
.
value
.
setMinutes
(
now
.
value
.
getMinutes
()
+
(
new
Date
().
getTimezoneOffset
()
+
props
.
offset
));
const
date
=
new
Date
();
date
.
setMinutes
(
now
.
value
.
getMinutes
()
+
(
new
Date
().
getTimezoneOffset
()
+
props
.
offset
));
now
.
value
=
date
;
}
function
calcColors
()
{
...
...
This diff is collapsed.
Click to expand it.
packages/client/src/components/global/time.vue
+
1
−
1
View file @
c4830dcf
...
...
@@ -20,7 +20,7 @@ const props = withDefaults(defineProps<{
const
_time
=
typeof
props
.
time
===
'
string
'
?
new
Date
(
props
.
time
)
:
props
.
time
;
const
absolute
=
_time
.
toLocaleString
();
let
now
=
$
r
ef
(
new
Date
());
let
now
=
$
shallowR
ef
(
new
Date
());
const
relative
=
$computed
(()
=>
{
const
ago
=
(
now
.
getTime
()
-
_time
.
getTime
())
/
1000
/*ms*/
;
return
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment