-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
Copy path404.vue
51 lines (47 loc) · 1.09 KB
/
404.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<template>
<div class="theme-container">
<div class="theme-default-content">
<ClientOnly>
<h1>404</h1>
<blockquote>{{ getMsg() }}</blockquote>
<RouterLink :to="localePath">
{{ notFoundLinkText }}
</RouterLink>
</ClientOnly>
</div>
</div>
</template>
<script>
export default {
computed: {
localePath () {
return this.$localePath || '/'
},
notFoundLinkText () {
return (
this.$themeLocaleConfig.notFoundLinkText
|| this.$site.themeConfig.notFoundLinkText
|| `Take me home.`
)
},
notFoundMessages () {
const messages = [
`There's nothing here.`,
`How did we get here?`,
`That's a Four-Oh-Four.`,
`Looks like we've got some broken links.`
]
return (
this.$themeLocaleConfig.notFoundMessages
|| this.$site.themeConfig.notFoundMessages
|| messages
)
}
},
methods: {
getMsg () {
return this.notFoundMessages[Math.floor(Math.random() * this.notFoundMessages.length)]
}
}
}
</script>