-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
/
Copy pathindex.js
93 lines (90 loc) · 2.29 KB
/
index.js
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { h } from 'vue'
import DefaultTheme from 'vitepress/dist/client/theme-default'
import AlgoliaSearchBox from './AlgoliaSearchBox.vue'
import './custom.css'
import { useData } from 'vitepress'
export default {
...DefaultTheme,
Layout: {
setup() {
const { lang } = useData()
return () => {
return h(DefaultTheme.Layout, null, {
'page-top': () => {
return lang.value === 'zh-CN' ? notice_zh_cn() : notice_en()
},
'navbar-search': () => {
return h(AlgoliaSearchBox, {
options: {
indexName: 'cli_vuejs',
apiKey: 'f6df220f7d246aff64a56300b7f19f21'
}
})
}
})
}
}
}
}
function notice_en() {
return h('div', { class: 'warning custom-block' }, [
h(
'p',
{ class: 'custom-block-title' },
'⚠️ Vue CLI is in Maintenance Mode!'
),
h('p', [
'For new projects, it is now recommended to use ',
h(
'a',
{
href: 'https://github.com/vuejs/create-vue',
target: '_blank'
},
[h('code', 'create-vue')]
),
' to scaffold ',
h('a', { href: 'https://vitejs.dev', target: '_blank' }, 'Vite'),
'-based projects. ',
'Also refer to the ',
h(
'a',
{
href: 'https://vuejs.org/guide/scaling-up/tooling.html',
target: '_blank'
},
'Vue 3 Tooling Guide'
),
' for the latest recommendations.'
])
])
}
function notice_zh_cn() {
return h('div', { class: 'warning custom-block' }, [
h('p', { class: 'custom-block-title' }, '⚠️ Vue CLI 现已处于维护模式!'),
h('p', [
'现在官方推荐使用 ',
h(
'a',
{
href: 'https://github.com/vuejs/create-vue',
target: '_blank'
},
[h('code', 'create-vue')]
),
' 来创建基于 ',
h('a', { href: 'https://cn.vitejs.dev', target: '_blank' }, 'Vite'),
' 的新项目。 ',
'另外请参考 ',
h(
'a',
{
href: 'https://cn.vuejs.org/guide/scaling-up/tooling.html',
target: '_blank'
},
'Vue 3 工具链指南'
),
' 以了解最新的工具推荐。'
])
])
}