chore: update

This commit is contained in:
linzhe141 2025-03-18 13:24:23 +08:00
parent ee324fbc45
commit 60a554cd86
2 changed files with 11 additions and 5 deletions

View File

@ -1,13 +1,17 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`compiler-dom: transform v-on > should wrap both for dynamic key event w/ once modifiers 1`] = ` exports[`compiler-dom: transform v-on > should wrap both for dynamic key event w/ event modifiers 1`] = `
"const _Vue = Vue "const _Vue = Vue
return function render(_ctx, _cache) { return function render(_ctx, _cache) {
with (_ctx) { with (_ctx) {
const { toHandlerKey: _toHandlerKey, checkDynamicEvent: _checkDynamicEvent, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue const { toHandlerKey: _toHandlerKey, checkDynamicEvent: _checkDynamicEvent, createElementVNode: _createElementVNode, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
return (_openBlock(), _createElementBlock("div", { [_checkDynamicEvent(_toHandlerKey(e),"Once")]: test }, null, 16 /* FULL_PROPS */)) return (_openBlock(), _createElementBlock(_Fragment, null, [
_createElementVNode("div", { [_checkDynamicEvent(_toHandlerKey(e),"Once")]: test }, null, 16 /* FULL_PROPS */),
_createElementVNode("div", { [_checkDynamicEvent(_toHandlerKey(e),"Passive")]: test }, null, 16 /* FULL_PROPS */),
_createElementVNode("div", { [_checkDynamicEvent(_toHandlerKey(e),"Capture")]: test }, null, 16 /* FULL_PROPS */)
], 64 /* STABLE_FRAGMENT */))
} }
}" }"
`; `;

View File

@ -169,8 +169,10 @@ describe('compiler-dom: transform v-on', () => {
}) })
}) })
it('should wrap both for dynamic key event w/ once modifiers', () => { it('should wrap both for dynamic key event w/ event modifiers', () => {
const { root: ast } = parseWithVOn(`<div @[e].once="test"/>`) const { root: ast } = parseWithVOn(
`<div @[e].once="test"/><div @[e].passive="test"/><div @[e].capture="test"/>`,
)
expect(generate(ast).code).toMatchSnapshot() expect(generate(ast).code).toMatchSnapshot()
}) })