Skip to content

Commit 7c0134e

Browse files
committed
docs: add recommendation for create-vue in docs
1 parent 95ad425 commit 7c0134e

File tree

8 files changed

+87
-37
lines changed

8 files changed

+87
-37
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## ⚠️ Status
44

5-
Vue CLI is now in maintenance mode. For new projects, please use [create-vue](https://github.com/vuejs/create-vue) to scaffold [Vite](https://vitejs.dev/)-based projects, which supports both Vue 2 and Vue 3.
5+
Vue CLI is now in maintenance mode. For new projects, please use [create-vue](https://github.com/vuejs/create-vue) to scaffold [Vite](https://vitejs.dev/)-based projects. `create-vue` supports both Vue 2 and Vue 3.
66

7-
Also refer to the latest [Tooling Guide](https://vuejs.org/guide/scaling-up/tooling.html) on setting up a new Vue 3 project.
7+
Also refer to the [Vue 3 Tooling Guide](https://vuejs.org/guide/scaling-up/tooling.html) for the latest recommendations.
88

99
For information on migrating from Vue CLI to Vite:
1010

docs/.vitepress/theme/index.js

+85-8
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,96 @@ import { h } from 'vue'
22
import DefaultTheme from 'vitepress/dist/client/theme-default'
33
import AlgoliaSearchBox from './AlgoliaSearchBox.vue'
44
import './custom.css'
5+
import { useData } from 'vitepress'
56

67
export default {
78
...DefaultTheme,
8-
Layout() {
9-
return h(DefaultTheme.Layout, null, {
10-
'navbar-search': () => {
11-
return h(AlgoliaSearchBox, {
12-
options: {
13-
indexName: 'cli_vuejs',
14-
apiKey: 'f6df220f7d246aff64a56300b7f19f21',
9+
Layout: {
10+
setup() {
11+
const { lang } = useData()
12+
return () => {
13+
return h(DefaultTheme.Layout, null, {
14+
'page-top': () => {
15+
return lang.value === 'zh-CN' ? notice_zh_cn() : notice_en()
16+
},
17+
'navbar-search': () => {
18+
return h(AlgoliaSearchBox, {
19+
options: {
20+
indexName: 'cli_vuejs',
21+
apiKey: 'f6df220f7d246aff64a56300b7f19f21'
22+
}
23+
})
1524
}
1625
})
1726
}
18-
})
27+
}
1928
}
2029
}
30+
31+
function notice_en() {
32+
return h('div', { class: 'warning custom-block' }, [
33+
h('p', { class: 'custom-block-title' }, '⚠️ Notice'),
34+
h('p', [
35+
'Vue CLI is now in maintenance mode. For new projects, please use ',
36+
h(
37+
'a',
38+
{
39+
href: 'https://github.com/vuejs/create-vue',
40+
target: '_blank'
41+
},
42+
[h('code', 'create-vue')]
43+
),
44+
' to scaffold ',
45+
h('a', { href: 'https://vitejs.dev', target: '_blank' }, 'Vite'),
46+
'-based projects. ',
47+
h('code', 'create-vue'),
48+
' supports both Vue 2 and Vue 3.'
49+
]),
50+
h('p', [
51+
'Also refer to the ',
52+
h(
53+
'a',
54+
{
55+
href: 'https://vuejs.org/guide/scaling-up/tooling.html',
56+
target: '_blank'
57+
},
58+
'Vue 3 Tooling Guide'
59+
),
60+
' for the latest recommendations.'
61+
])
62+
])
63+
}
64+
65+
function notice_zh_cn() {
66+
return h('div', { class: 'warning custom-block' }, [
67+
h('p', { class: 'custom-block-title' }, '⚠️ Notice'),
68+
h('p', [
69+
'Vue CLI 现已处于维护模式。新项目请使用 ',
70+
h(
71+
'a',
72+
{
73+
href: 'https://github.com/vuejs/create-vue',
74+
target: '_blank'
75+
},
76+
[h('code', 'create-vue')]
77+
),
78+
' 来创建基于 ',
79+
h('a', { href: 'https://cn.vitejs.dev', target: '_blank' }, 'Vite'),
80+
' 的项目. ',
81+
h('code', 'create-vue'),
82+
' 同时支持 Vue 2 和 Vue 3.'
83+
]),
84+
h('p', [
85+
'另外,请参考 ',
86+
h(
87+
'a',
88+
{
89+
href: 'https://vuejs.org/guide/scaling-up/tooling.html',
90+
target: '_blank'
91+
},
92+
'Vue 3 工具链指南'
93+
),
94+
' 以了解最新的工具推荐。'
95+
])
96+
])
97+
}

docs/guide/index.md

-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ sidebarDepth: 0
44

55
# Overview
66

7-
::: warning
8-
This documentation is for `@vue/cli`. For the old `vue-cli`, see [here](https://github.com/vuejs/vue-cli/tree/v2#vue-cli--).
9-
:::
10-
117
Vue CLI is a full system for rapid Vue.js development, providing:
128

139
- Interactive project scaffolding via `@vue/cli`.

docs/guide/installation.md

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
# Installation
22

3-
::: warning Warning regarding Previous Versions
4-
The package name changed from `vue-cli` to `@vue/cli`.
5-
If you have the previous `vue-cli` (1.x or 2.x) package installed globally, you need to uninstall it first with `npm uninstall vue-cli -g` or `yarn global remove vue-cli`.
6-
:::
7-
83
::: tip Node Version Requirement
94
Vue CLI 4.x requires [Node.js](https://nodejs.org/) version 8.9 or above (v10+ recommended). You can manage multiple versions of Node on the same machine with [n](https://github.com/tj/n), [nvm](https://github.com/creationix/nvm) or [nvm-windows](https://github.com/coreybutler/nvm-windows).
105
:::

docs/ru/guide/index.md

-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ sidebarDepth: 0
44

55
# Введение
66

7-
::: warning Предупреждение
8-
Эта документация для `@vue/cli`. Для старой версии `vue-cli`, см. [здесь](https://github.com/vuejs/vue-cli/tree/v2#vue-cli--).
9-
:::
10-
117
Vue CLI — полноценная система для быстрой разработки на Vue.js, предоставляющая:
128

139
- Интерактивное создание проекта через `@vue/cli`.

docs/ru/guide/installation.md

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
# Установка
22

3-
::: danger Предупреждение о предыдущих версиях
4-
Имя пакета изменилось с `vue-cli` на `@vue/cli`.
5-
Если у вас установлена глобально предыдущая версия пакета `vue-cli` (1.x или 2.x), то необходимо сначала удалить её командой `npm uninstall vue-cli -g` или `yarn global remove vue-cli`.
6-
:::
7-
83
::: tip Требования к версии Node
94
Vue CLI 4.x требуется [Node.js](https://nodejs.org/) версии 8.9 или выше (рекомендуется v10+). Управлять несколькими версиями Node на машине можно через [n](https://github.com/tj/n), [nvm](https://github.com/creationix/nvm) или [nvm-windows](https://github.com/coreybutler/nvm-windows).
105
:::

docs/zh/guide/index.md

-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ sidebarDepth: 0
44

55
# 介绍
66

7-
::: warning 警告
8-
这份文档对应的是 `@vue/cli`。老版本的 `vue-cli` 文档请移步[这里](https://github.com/vuejs/vue-cli/tree/v2#vue-cli--)
9-
:::
10-
117
Vue CLI 是一个基于 Vue.js 进行快速开发的完整系统,提供:
128

139
- 通过 `@vue/cli` 实现的交互式的项目脚手架。

docs/zh/guide/installation.md

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
# 安装
22

3-
::: warning 关于旧版本
4-
Vue CLI 的包名称由 `vue-cli` 改成了 `@vue/cli`
5-
如果你已经全局安装了旧版本的 `vue-cli` (1.x 或 2.x),你需要先通过 `npm uninstall vue-cli -g``yarn global remove vue-cli` 卸载它。
6-
:::
7-
83
::: tip Node 版本要求
94
Vue CLI 4.x 需要 [Node.js](https://nodejs.org/) v8.9 或更高版本 (推荐 v10 以上)。你可以使用 [n](https://github.com/tj/n)[nvm](https://github.com/creationix/nvm)[nvm-windows](https://github.com/coreybutler/nvm-windows) 在同一台电脑中管理多个 Node 版本。
105
:::

0 commit comments

Comments
 (0)