exportRender
Stability:
experimental
⚠️ Experimental feature, use at your riskTransform the default export statement, in <script setup>
of Vue SFC, as a component render function.
Features | Supported |
---|---|
Vue 3 | ✅ |
Nuxt 3 | ❓ |
Vue 2 | ✅ |
Volar Plugin | ✅ |
TIP
This feature depends on defineRender
, and make sure defineRender
is not disabled.
Usage
vue
<script setup lang="tsx">
// JSX passed directly
export default <div>ok</div>
// Or using render function
export default () => <div>ok</div>
</script>
Volar Configuration
jsonc
// tsconfig.json
{
"vueCompilerOptions": {
"target": 3,
"plugins": [
"@vue-macros/volar/export-render",
// ...more feature
],
},
}