diff --git a/docs/.vitepress/locales/common.ts b/docs/.vitepress/locales/common.ts index ce9cd4d3e..5f4fa5172 100644 --- a/docs/.vitepress/locales/common.ts +++ b/docs/.vitepress/locales/common.ts @@ -30,7 +30,7 @@ gtag('config', 'G-29NKGSL23C');`, ], ] -export const sidebar = (lang: string): DefaultTheme.Sidebar => { +export const sidebar = (lang: string): DefaultTheme.SidebarItem[] => { const urlPrefix = lang ? `/${lang}` : '' return [ { diff --git a/docs/.vitepress/locales/zh-cn.ts b/docs/.vitepress/locales/zh-cn.ts index 3ec9d7efd..f19d824db 100644 --- a/docs/.vitepress/locales/zh-cn.ts +++ b/docs/.vitepress/locales/zh-cn.ts @@ -12,6 +12,19 @@ export const nav: DefaultTheme.NavItem[] = [ export const sidebar = common.sidebar('zh-CN') +const sidebarTitle: string[] = ['指南', '宏', '特性'] +const sidebarItem: string[][] = [ + ['入门', '打包器整合', 'Nuxt 整合', '配置'], + ['全部宏'], + [''], +] +sidebar.forEach((bar, i) => { + bar.text = sidebarTitle[i] + bar.items!.forEach((item, j) => { + if (sidebarItem[i][j]) item.text = sidebarItem[i][j] + }) +}) + export const themeConfig: DefaultTheme.Config = { ...common.themeConfig, diff --git a/docs/zh-CN/features/better-define.md b/docs/zh-CN/features/better-define.md index 99608743e..424627b06 100644 --- a/docs/zh-CN/features/better-define.md +++ b/docs/zh-CN/features/better-define.md @@ -1,19 +1,19 @@ # betterDefine -Stability: stable +稳定性: 稳定 -With enabling `betterDefine`, imported types are supported in ` ``` -::: details Compiled Code +::: details 编译后代码 ```vue ``` -::: details Compiled Code +::: details 编译后代码 ```vue ``` -::: warning ❌ Object declaring is not supported. +::: warning ❌ 不支持对象声明 ```vue ``` -## With Reactivity Transform +## 响应性语法糖 ::: warning -Assignment expression is only supported in ` ``` -::: details Compiled Code +::: details 编译后代码 ```vue ``` -::: details Compiled Code +::: details 编译后代码 ```vue ``` -::: details Compiled Code +::: details 编译后代码 ```vue ``` -## Volar Configuration +## Volar 配置 ```jsonc {6} // tsconfig.json diff --git a/docs/zh-CN/macros/define-props.md b/docs/zh-CN/macros/define-props.md index 610f63fc3..b8d8c1609 100644 --- a/docs/zh-CN/macros/define-props.md +++ b/docs/zh-CN/macros/define-props.md @@ -1,12 +1,12 @@ # defineProps -Stability: stable +稳定性: 稳定 -Correct types of destructured props using `$defineProps`. +使用 `$defineProps` 可以正确的解构 `props` 的类型 -See also [Vue issue](https://github.com/vuejs/core/issues/6876), [Reactivity Transform RFC](https://github.com/vuejs/rfcs/blob/reactivity-transform/active-rfcs/0000-reactivity-transform.md#defineprops-destructure-details). +参见 [Vue issue](https://github.com/vuejs/core/issues/6876), [Reactivity Transform RFC](https://github.com/vuejs/rfcs/blob/reactivity-transform/active-rfcs/0000-reactivity-transform.md#defineprops-destructure-details). -| Features | Supported | +| 特性 | 支持 | | :-----------------------: | :----------------: | | Vue 3 | :white_check_mark: | | Nuxt 3 | :white_check_mark: | @@ -15,11 +15,11 @@ See also [Vue issue](https://github.com/vuejs/core/issues/6876), [Reactivity Tra ::: warning -[Reactivity Transform](https://vuejs.org/guide/extras/reactivity-transform.html) is required. You should enable it first. +在开始之前,你必须先开启 [响应性语法糖](https://cn.vuejs.org/guide/extras/reactivity-transform.html) ::: -## Basic Usage +## 基本用法 ```vue ``` -## Volar Configuration +## Volar 配置 ```jsonc {6} // tsconfig.json diff --git a/docs/zh-CN/macros/define-render.md b/docs/zh-CN/macros/define-render.md index ee96c3919..c4cf7edfe 100644 --- a/docs/zh-CN/macros/define-render.md +++ b/docs/zh-CN/macros/define-render.md @@ -1,17 +1,17 @@ # defineRender -Stability: stable +稳定性: 稳定 -Defining render function in ` ``` -## Volar Configuration +## Volar 配置 ```jsonc {6} // tsconfig.json diff --git a/docs/zh-CN/macros/index.md b/docs/zh-CN/macros/index.md index 7c3a355e6..a78afb161 100644 --- a/docs/zh-CN/macros/index.md +++ b/docs/zh-CN/macros/index.md @@ -1,16 +1,16 @@ -# Usage +# 用法 -List of all available macros. +以下是所有可用宏的列表。 -Please make sure `unplugin-vue-macros` is set up correctly. If you haven't yet, read [Getting Started](/guide/getting-started) first. +在开始之前,请确保 `unplugin-vue-macros` 设置正确。如果你还没有设置,请先阅读 [入门](/zh-CN/guide/getting-started) -- [defineOptions](/macros/define-options) -- [defineModel](/macros/define-model) -- [defineProps](/macros/define-props) -- [definePropsRefs](/macros/define-props-refs)unstable -- [defineSlots](/macros/define-slots)unstable -- [defineRender](/macros/define-render) -- [shortEmits](/macros/short-emits) -- [shortVmodel](/macros/short-vmodel) -- [setupComponent](/macros/setup-component) Experimental -- [setupSFC](/macros/setup-sfc) Experimental +- [defineOptions](/zh-CN/macros/define-options) +- [defineModel](/zh-CN/macros/define-model) +- [defineProps](/zh-CN/macros/define-props) +- [definePropsRefs](/macros/define-props-refs) 尚未稳定 +- [defineSlots](/zh-CN/macros/define-slots) 尚未稳定 +- [defineRender](/zh-CN/macros/define-render) +- [shortEmits](/zh-CN/macros/short-emits) +- [shortVmodel](/zh-CN/macros/short-vmodel) +- [setupComponent](/zh-CN/macros/setup-component) 实验性 +- [setupSFC](/zh-CN/macros/setup-sfc) 实验性 diff --git a/docs/zh-CN/macros/setup-component.md b/docs/zh-CN/macros/setup-component.md index a6c7ae244..120488780 100644 --- a/docs/zh-CN/macros/setup-component.md +++ b/docs/zh-CN/macros/setup-component.md @@ -1,28 +1,30 @@ # setupComponent - Stability: experimental + 稳定性: 实验性 -Experimental, use at your risk +实验性功能,风险自负 ::: tip -If you're using `setupComponent`, then `defineRender` cannot be disabled. +如果你使用的是 `setupComponent`,则无法禁用 `defineRender`。 -Files in `node_modules` will not be ignored by default. +默认情况下不会忽略 `node_modules` 中的文件。 ::: -With `defineSetupComponent`, `