Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

<script setup> must has attribute lang="js" ? #3

Closed
@zhanglolo

Description

@zhanglolo

I like this plugin, great idea!!!

Here are my doubts:

if script don't has attribute lang="js" then get an error

[plugin:vue2-script-setup-transform] Unsupported script language: undefined

add to fix it, is something miss in document or just a bug?

The point of the error code:

if (lang === 'ts')
  plugins.push('typescript')
else if (lang === 'jsx')
  plugins.push('jsx')
else if (lang === 'tsx')
  plugins.push('typescript', 'jsx')
else if (lang !== 'js')
  throw new SyntaxError(`Unsupported script language: ${lang}`)

source code:

<template>
  <div>
    <h1>{{ msg }}</h1>
  </div>
</template>

<script setup>
import { ref } from "@vue/composition-api";

const msg = ref("bar")
</script>

<style></style>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions