Skip to content

Commit d06d6a2

Browse files
committed
fix(guide): translate sections in composition-api.md to Chinese
1 parent da9cb0c commit d06d6a2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/guide/typescript/composition-api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,9 @@ const openModal = () => {
479479

480480
请注意在 `@vue/language-tools` 2.1 以上版本中,静态模板 ref 的类型可以被自动推导,上述这些仅在极端情况下需要。
481481

482-
## Typing Global Custom Directives {#typing-global-custom-directives}
482+
## 为自定义全局指令添加类型 {#typing-global-custom-directives}
483483

484-
In order to get type hints and type checking for global custom directives declared with `app.directive()`, you can extend `ComponentCustomProperties`
484+
可以通过扩展 `ComponentCustomProperties` 来为使用 `app.directive()` 声明的全局自定义指令获取类型提示和类型检查
485485

486486
```ts [src/directives/highlight.ts]
487487
import type { Directive } from 'vue'
@@ -490,7 +490,7 @@ export type HighlightDirective = Directive<HTMLElement, string>
490490

491491
declare module 'vue' {
492492
export interface ComponentCustomProperties {
493-
// prefix with v (v-highlight)
493+
// 使用 v 作为前缀 (v-highlight)
494494
vHighlight: HighlightDirective
495495
}
496496
}
@@ -504,12 +504,12 @@ export default {
504504

505505
```ts [main.ts]
506506
import highlight from './directives/highlight'
507-
// ...other code
507+
// ...其它代码
508508
const app = createApp(App)
509509
app.directive('highlight', highlight)
510510
```
511511

512-
Usage in component
512+
在组件中使用
513513

514514
```vue [App.vue]
515515
<template>

0 commit comments

Comments
 (0)