Skip to content

Commit b243505

Browse files
Revert "fix: typing component refs (#2210)" (#2235)
This reverts commit 9c1c4ca.
1 parent 4895c57 commit b243505

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/guide/typescript/composition-api.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,15 +401,14 @@ defineExpose({
401401
</script>
402402
```
403403

404-
In order to get the instance type of `MyModal`, we need to first get its type via `typeof`, then use Vue's `ComponentPublicInstance` utility to extract its instance type:
404+
In order to get the instance type of `MyModal`, we need to first get its type via `typeof`, then use TypeScript's built-in `InstanceType` utility to extract its instance type:
405405

406406
```vue{5}
407407
<!-- App.vue -->
408408
<script setup lang="ts">
409-
import { ComponentPublicInstance } from 'vue';
410409
import MyModal from './MyModal.vue'
411410
412-
const modal = ref<ComponentPublicInstance<typeof MyModal> | null>(null)
411+
const modal = ref<InstanceType<typeof MyModal> | null>(null)
413412
414413
const openModal = () => {
415414
modal.value?.open()

0 commit comments

Comments
 (0)