import without new line at the top of setup script + defineProps causes error
Version
3.2.19
Reproduction link
Steps to reproduce
- open the repro
What is expected?
const props = __props; import { ref } from 'vue'
What is actually happening?
编译成的代码: const props = __propsimport { ref } from 'vue'
第一句import那里如果不换号就会出错,vue文件会编译成 ......props=propsimport { reactive,ref} ......,应该是少一个";" 如果import那句换行的话,就不会出错了
<script setup>import { ref } from 'vue' // this line will cause an error
const props=defineProps({
foo:String
})
const msg = ref('Hello World!')
</script>
<template>
<h1>{{ msg }}</h1>
<input v-model="msg">
</template>