Skip to content

Commit

Permalink
docs: translate guide/typescript/composition-api.md (#995)
Browse files Browse the repository at this point in the history
* docs: translate guide/typescript/composition-api.md

* Update src/guide/typescript/composition-api.md

Co-authored-by: wxsm <[email protected]>

* Update src/guide/typescript/composition-api.md

Co-authored-by: wxsm <[email protected]>

---------

Co-authored-by: wxsm <[email protected]>
  • Loading branch information
bsuooo and wxsms authored Aug 22, 2024
1 parent 84c0717 commit dafb0ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/guide/typescript/composition-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ import type { ComponentPublicInstance } from 'vue'
const child = ref<ComponentPublicInstance | null>(null)
```

In cases where the component referenced is a [generic component](/guide/typescript/overview.html#generic-components), for instance `MyGenericModal`:
如果引用的组件是一个[泛型组件](/guide/typescript/overview.html#generic-components),例如 `MyGenericModal`

```vue
<!-- MyGenericModal.vue -->
Expand All @@ -441,7 +441,7 @@ defineExpose({
</script>
```

It needs to be referenced using `ComponentExposed` from the [`vue-component-type-helpers`](https://www.npmjs.com/package/vue-component-type-helpers) library as `InstanceType` won't work.
则需要使用 [`vue-component-type-helpers`](https://www.npmjs.com/package/vue-component-type-helpers) 库中的 `ComponentExposed` 来引用组件类型,因为 `InstanceType` 在这种场景下不起作用。

```vue
<!-- App.vue -->
Expand Down

0 comments on commit dafb0ca

Please sign in to comment.