fix(compiler-sfc): fix import usage check in template strings in expressions

fix #4340
This commit is contained in:
Evan You
2021-08-16 18:03:03 -04:00
parent ad66295cb3
commit f855ccb2c1
3 changed files with 18 additions and 6 deletions

View File

@@ -206,7 +206,7 @@ return { x }
exports[`SFC compile <script setup> imports imports not used in <template> should not be exposed 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
import { FooBar, FooBaz, FooQux, vMyDir, x, y, z, x$y, Last } from './x'
import { FooBar, FooBaz, FooQux, vMyDir, x, y, z, x$y, VAR, VAR2, VAR3, Last } from './x'
export default _defineComponent({
setup(__props, { expose }) {
@@ -214,7 +214,7 @@ export default _defineComponent({
const fooBar: FooBar = 1
return { fooBar, FooBaz, FooQux, vMyDir, x, z, x$y, Last }
return { fooBar, FooBaz, FooQux, vMyDir, x, z, x$y, VAR, VAR3, Last }
}
})"