Skip to content

scriptLang NPM Version

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

Set the default language for <script> block.

TIP

Convert <script setup> to <script setup lang="ts">.

FeaturesSupported
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
// tsconfig.json
{
  "vueCompilerOptions": {
    "target": 3,
    "plugins": [
      "@vue-macros/volar/script-lang",
      // ...more feature
    ],
  },
}

Contributors

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

Changelog