docs(form): use useTemplateRef

This commit is contained in:
Benjamin Canac
2024-10-15 15:09:21 +02:00
parent 16b48efa96
commit 8258cd3829
5 changed files with 20 additions and 9 deletions

View File

@@ -167,7 +167,19 @@ name: 'form-example-nested-list'
### Expose
When accessing the component via a template ref, you can use the following:
You can access the typed component instance using [`useTemplateRef`](https://vuejs.org/api/composition-api-helpers.html#usetemplateref).
```vue
<script setup lang="ts">
const form = useTemplateRef('form')
</script>
<template>
<UForm ref="form" />
</template>
```
This will give you access to the following:
| Name | Type |
| ---- | ---- |