ref: https://github.com/vuejs/vue/issues/12591
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', () => {
if (/ as\s+\w|<.*>|:/.test(exp)) {
if (dir === 'slot') {
exp = `(${exp})=>{}`
+ } else if (dir === 'on') {
+ exp = `()=>{${exp}}`
} else if (dir === 'for') {
const inMatch = exp.match(forAliasRE)
if (inMatch) {