fix(compiler-sfc): support TS runtime enum in <script setup>
This commit is contained in:
@@ -824,6 +824,18 @@ const emit = defineEmits(['a', 'b'])
|
||||
expect(content).toMatch(`emit: ((e: 'foo' | 'bar') => void),`)
|
||||
expect(content).toMatch(`emits: ["foo", "bar"] as unknown as undefined`)
|
||||
})
|
||||
|
||||
test('runtime Enum', () => {
|
||||
const { content, bindings } = compile(
|
||||
`<script setup lang="ts">
|
||||
enum Foo { A = 123 }
|
||||
</script>`
|
||||
)
|
||||
assertCode(content)
|
||||
expect(bindings).toStrictEqual({
|
||||
Foo: BindingTypes.SETUP_CONST
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('async/await detection', () => {
|
||||
|
||||
Reference in New Issue
Block a user