File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/client/theme-default/components Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
- import { ref , watchEffect , onMounted } from ' vue'
2
+ import { ref , computed , watchEffect , onMounted } from ' vue'
3
3
import { useData } from ' vitepress'
4
4
5
5
const { theme, page } = useData ()
6
6
7
- const date = new Date (page .value .lastUpdated ! )
8
- const isoDatetime = date .toISOString ()
7
+ const date = computed (() => new Date (page .value .lastUpdated ! ) )
8
+ const isoDatetime = computed (() => date .value . toISOString () )
9
9
const datetime = ref (' ' )
10
10
11
11
// set time on mounted hook because the locale string might be different
12
12
// based on end user and will lead to potential hydration mismatch if
13
13
// calculated at build time
14
14
onMounted (() => {
15
15
watchEffect (() => {
16
- datetime .value = date .toLocaleString (window .navigator .language )
16
+ datetime .value = date .value . toLocaleString (window .navigator .language )
17
17
})
18
18
})
19
19
</script >
You can’t perform that action at this time.
0 commit comments