scriptLang
Stability:
experimental ⚠️ Experimental feature, use at your riskSet the default language for <script> block.
TIP
Convert <script setup> to <script setup lang="ts">.
| Features | Supported |
|---|---|
| Vue 3 | ✅ |
| Nuxt 3 | ✅ |
| Vue 2 | ✅ |
| Volar Plugin | ✅ |
Options
ts
interface Options {
/**
* @default 'ts'
*/
defaultLang?: 'ts' | 'tsx' | 'jsx' | string
}Usage
vue
<script setup>
defineProps<{
foo: string
}>()
</script>Volar Configuration
jsonc
{
"vueCompilerOptions": {
"plugins": ["vue-macros/volar"],
"vueMacros": {
"scriptLang": {
"defaultLang": "ts",
},
},
},
}
Kevin Deng
zhiyuanzmj
Leo
Alex