fix(compiler-sfc): fix template usage check edge case for v-on statements

ref: https://github.com/vuejs/vue/issues/12591
This commit is contained in:
Evan You
2022-07-04 11:49:47 +08:00
parent fb3bfde264
commit 769e5555f9
2 changed files with 15 additions and 0 deletions

View File

@@ -461,6 +461,19 @@ defineExpose({ foo: 123 })
expect(content).toMatch(`return { a, b, Baz }`)
assertCode(content)
})
// vuejs/vue#12591
test('v-on inline statement', () => {
// should not error
compile(`
<script setup lang="ts">
import { foo } from './foo'
</script>
<template>
<div @click="$emit('update:a');"></div>
</tempalte>
`)
})
})
describe('inlineTemplate mode', () => {