Skip to content

Commit 6912db3

Browse files
authored
Apply suggestions from code review
1 parent 07b415c commit 6912db3

File tree

10 files changed

+19
-17
lines changed

10 files changed

+19
-17
lines changed

.vitepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ export const sidebar: ThemeConfig['sidebar'] = {
370370
link: '/api/composition-api-dependency-injection'
371371
},
372372
{
373-
text: 'Helpers',
373+
text: '辅助',
374374
link: '/api/composition-api-helpers'
375375
}
376376
]

src/api/application.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292

9393
## app.onUnmount() <sup class="vt-badge" data-text="3.5+" /> {#app-onunmount}
9494

95-
注册应用程序卸载时要调用的回调
95+
注册一个回调函数,在应用卸载时调用
9696

9797
- **类型**
9898

@@ -285,7 +285,7 @@ Mixins 在 Vue 3 支持主要是为了向后兼容,因为生态中有许多库
285285

286286
## app.runWithContext() {#app-runwithcontext}
287287

288-
- Only supported in 3.3+
288+
- 仅在 3.3+ 中支持
289289

290290
使用当前应用作为注入上下文执行回调函数。
291291

@@ -649,9 +649,9 @@ console.log(app.config)
649649

650650
强制在生产模式下抛出未处理的错误。
651651

652-
- **类型:** `boolean`
652+
- **类型** `boolean`
653653

654-
- **默认值:** `false`
654+
- **默认值** `false`
655655

656656
- **详情**
657657

src/api/built-in-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ h(Transition, {
313313
</Teleport>
314314
```
315315

316-
推迟解析目标 <sup class="vt-badge" data-text="3.5+" />:
316+
延迟目标解析 <sup class="vt-badge" data-text="3.5+" />
317317

318318
```vue-html
319319
<Teleport defer to="#late-div">...</Teleport>

src/api/built-in-directives.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@
259259

260260
- **缩写:**
261261
- `:` 或者 `.` (当使用 `.prop` 修饰符)
262-
- 值可以省略当 attribute 和绑定的值同名时,需要 3.4+ 版本
262+
- 值可以省略 (当 attribute 和绑定的值同名时,需要 3.4+ 版本)
263263

264264
- **期望:**`any (带参数) | Object (不带参数)`
265265

@@ -268,8 +268,8 @@
268268
- **修饰符**
269269

270270
- `.camel` - 将短横线命名的 attribute 转变为驼峰式命名。
271-
- `.prop` - 强制绑定为 DOM property3.2+
272-
- `.attr` - 强制绑定为 DOM attribute3.2+
271+
- `.prop` - 强制绑定为 DOM property (3.2+)
272+
- `.attr` - 强制绑定为 DOM attribute (3.2+)
273273

274274
- **用途**
275275

src/api/composition-api-helpers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- TODO: translation -->
12
# Composition API: Helpers {#composition-api-helpers}
23

34
## useAttrs() {#useattrs}

src/api/custom-elements.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- TODO: translation -->
12
# Custom Elements API {#custom-elements-api}
23

34
## defineCustomElement() {#definecustomelement}

src/api/reactivity-advanced.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@
336336

337337
这个方法可以作为可复用的组合式函数中 `onUnmounted` 的替代品,它并不与组件耦合,因为每一个 Vue 组件的 `setup()` 函数也是在一个 effect 作用域中调用的。
338338

339-
如果在没有 effect 作用域的情况下调用此函数,将会抛出警告。在 3.5+ 版本中,可以通过将第二个参数设为 `true` 来抑制此警告
339+
如果在没有活跃的 effect 作用域的情况下调用此函数,将会抛出警告。在 3.5+ 版本中,可以通过将第二个参数设为 `true` 来消除此警告
340340

341341
- **类型**
342342

src/api/reactivity-core.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
stop()
316316
```
317317

318-
副作用清理:
318+
副作用清理
319319

320320
```js
321321
watchEffect(async (onCleanup) => {
@@ -327,7 +327,7 @@
327327
})
328328
```
329329

330-
Side effect cleanup in 3.5+:
330+
3.5+ 中的副作用清理:
331331

332332
```js
333333
import { onWatcherCleanup } from 'vue'
@@ -525,7 +525,7 @@
525525
stop()
526526
```
527527

528-
暂停/恢复侦听器: <sup class="vt-badge" data-text="3.5+" />
528+
暂停/恢复侦听器<sup class="vt-badge" data-text="3.5+" />
529529

530530
```js
531531
const { stop, pause, resume } = watchEffect(() => {})
@@ -571,7 +571,7 @@
571571

572572
## onWatcherCleanup() <sup class="vt-badge" data-text="3.5+" /> {#onwatchercleanup}
573573

574-
注册一个清理函数,在当前侦听器即将重新运行时执行。只能在 `watchEffect` 作用函数或 `watch` 回调函数的同步执行期间调用即不能在异步函数的 `await` 语句之后调用
574+
注册一个清理函数,在当前侦听器即将重新运行时执行。只能在 `watchEffect` 作用函数或 `watch` 回调函数的同步执行期间调用 (即不能在异步函数的 `await` 语句之后调用)
575575

576576
- **类型**
577577

src/api/sfc-script-setup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ watchEffect(() => {
234234
})
235235
```
236236

237-
此外,你可以使用 JavaScript 原生的默认值语法声明 props 默认值。这在使用基于类型的 props 声明时特别有用。
237+
此外,你可以使用 JavaScript 原生的默认值语法声明 props 的默认值。这在使用基于类型的 props 声明时特别有用。
238238

239239
```ts
240240
interface Props {
@@ -264,7 +264,7 @@ const props = withDefaults(defineProps<Props>(), {
264264
上面代码会被编译为等价的运行时 props 的 `default` 选项。此外,`withDefaults` 辅助函数提供了对默认值的类型检查,并确保返回的 `props` 的类型删除了已声明默认值的属性的可选标志。
265265

266266
:::info
267-
请注意,在使用 `withDefaults` 时,默认值为可变引用类型如数组或对象应该封装在函数中,以避免意外修改和外部副作用。这样可以确保每个组件实例都获得默认值的自己的副本。在使用默认值解构时,这****是必要的。
267+
请注意,在使用 `withDefaults` 时,默认值为可变引用类型 (如数组或对象) 应该封装在函数中,以避免意外修改和外部副作用。这样可以确保每个组件实例都获得默认值的自己的副本。在使用默认值解构时,这****是必要的。
268268
:::
269269

270270
## defineModel() {#definemodel}

src/api/ssr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@
223223

224224
## data-allow-mismatch <sup class="vt-badge" data-text="3.5+" /> {#data-allow-mismatch}
225225

226-
可以抑制[激活不匹配](/guide/scaling-up/ssr#hydration-mismatch)警告的特殊 attribute
226+
可以消除[激活不匹配](/guide/scaling-up/ssr#hydration-mismatch)警告的特殊 attribute
227227

228228
- **示例**
229229

0 commit comments

Comments
 (0)