Skip to content

scriptLang NPM Version

稳定性: 实验性 ⚠️ 实验性功能,风险自负

<script> 块设置默认语言。

TIP

<script setup> 转换为 <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
    ],
  },
}

贡献者

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

页面历史