defineRender
Stability:
stable
Defining render function in <script setup>
using the defineRender
.
Features | Supported |
---|---|
Vue 3 | ✅ |
Nuxt 3 | ✅ |
Vue 2 | ✅ |
TypeScript | ✅ |
Basic Usage
vue
<script setup lang="tsx">
// JSX passed directly
defineRender(
<div>
<span>Hello</span>
</div>
)
// Or using render function
defineRender(() => {
return (
<div>
<h1>Hello World</h1>
</div>
)
})
</script>