mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-23 16:30:45 +01:00
docs(form): use useTemplateRef
This commit is contained in:
@@ -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 |
|
||||
| ---- | ---- |
|
||||
|
||||
Reference in New Issue
Block a user