Skip to content

Commit

Permalink
docs: update template refs render function (#3126)
Browse files Browse the repository at this point in the history
* docs: update template refs render function

* chore: remove sample

* Update src/guide/extras/render-function.md

resolved conversation

Co-authored-by: Natalia Tepluhina <tarya.se@gmail.com>

---------

Co-authored-by: Natalia Tepluhina <tarya.se@gmail.com>
  • Loading branch information
2 people authored and Abdelaziz18003 committed Jan 22, 2025
1 parent 2890c7c commit 705d843
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/guide/extras/render-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,21 @@ export default {
}
```

or (with version >= 3.5)

```js
import { h, useTemplateRef } from 'vue'

export default {
setup() {
const divEl = useTemplateRef('my-div')

// <div ref="divEl">
return () => h('div', { ref: 'my-div' })
}
}
```

</div>
<div class="options-api">

Expand Down

0 comments on commit 705d843

Please sign in to comment.