exportProps
Stability:
experimental
⚠️ Experimental feature, use at your riskSvelte-like Declaring props for Vue.
Features | Supported |
---|---|
Vue 3 | ✅ |
Nuxt 3 | ❓ |
Vue 2 | ✅ |
Volar Plugin | ✅ |
Usage
Using export syntax to declare props.
vue
<script setup lang="ts">
export let foo: string
export const bar: number = 1 // with default value
</script>
Volar Configuration
jsonc
// tsconfig.json
{
"vueCompilerOptions": {
"target": 3,
"plugins": [
"@vue-macros/volar/export-props",
// ...more feature
],
},
}