Skip to content

exportProps NPM Version

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

Svelte-like Declaring props for Vue.

FeaturesSupported
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": {
    "plugins": ["unplugin-vue-macros/volar"],
    "vueMacros": {
      "exportProps": true,
    },
  },
}

Contributors

The avatar of contributor named as zhiyuanzmj zhiyuanzmj
The avatar of contributor named as Kevin Deng Kevin Deng
The avatar of contributor named as gaokefei gaokefei

Changelog