Skip to content

exportRender

Stability: experimental ⚠️ Experimental feature, use at your risk

Transform the default export statement, in <script setup> of Vue SFC, as a component render function.

FeaturesSupported
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
    ],
  },
}

Contributors

The avatar of contributor named as renovate[bot] renovate[bot]
The avatar of contributor named as gaokefei gaokefei

Changelog