Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit a038acb

Browse files
committed
chore: update test case
1 parent 414fe95 commit a038acb

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

test/__snapshots__/transform.test.ts.snap

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,3 +954,42 @@ export default __sfc_main;
954954
</script>
955955
"
956956
`;
957+
958+
exports[`transform > fixtures > test/fixtures/VariableBinding.vue 1`] = `
959+
"<script lang=\\"ts\\">
960+
/* eslint-disable no-console */
961+
import { reactive } from '@vue/composition-api';
962+
const __sfc_main = {};
963+
964+
__sfc_main.setup = (__props, __ctx) => {
965+
const state = reactive({
966+
value: ''
967+
});
968+
969+
function showEvent(event: MouseEvent) {
970+
console.log(event);
971+
}
972+
973+
const emit = __ctx.emit;
974+
return {
975+
state,
976+
showEvent,
977+
emit
978+
};
979+
};
980+
981+
export default __sfc_main;
982+
</script>
983+
<template>
984+
<div
985+
@click=\\"
986+
state.value = \`x: \${$event.x}\`
987+
showEvent($event)
988+
emit('foo')
989+
\\"
990+
>
991+
2333
992+
</div>
993+
</template>
994+
"
995+
`;

test/fixtures/VariableBinding.vue

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<script setup lang="ts">
2+
/* eslint-disable no-console */
3+
import { reactive } from '@vue/composition-api'
4+
const state = reactive({ value: '' })
5+
function showEvent(event: MouseEvent) {
6+
console.log(event)
7+
}
8+
const emit = defineEmits<{
9+
(event: 'foo'): void
10+
}>()
11+
</script>
12+
<template>
13+
<div
14+
@click="
15+
state.value = `x: ${$event.x}`
16+
showEvent($event)
17+
emit('foo')
18+
"
19+
>
20+
2333
21+
</div>
22+
</template>

0 commit comments

Comments
 (0)