refactor(v-on): do not generate persistent flag when no listener modifier is present

This commit is contained in:
Evan You
2019-10-14 23:06:51 -04:00
parent bd0bc3b3e6
commit c7074c703e
2 changed files with 21 additions and 21 deletions

View File

@@ -37,13 +37,10 @@ describe('compiler-dom: transform v-on', () => {
})
expect(prop).toMatchObject({
type: NodeTypes.JS_PROPERTY,
value: createObjectMatcher({
handler: {
callee: V_ON_MODIFIERS_GUARD,
arguments: [{ content: '_ctx.test' }, '["stop","prevent"]']
},
persistent: { content: 'true', isStatic: false }
})
value: {
callee: V_ON_MODIFIERS_GUARD,
arguments: [{ content: '_ctx.test' }, '["stop","prevent"]']
}
})
})
@@ -59,11 +56,11 @@ describe('compiler-dom: transform v-on', () => {
callee: V_ON_MODIFIERS_GUARD,
arguments: [{ content: '_ctx.test' }, '["stop"]']
},
persistent: { content: 'true', isStatic: false },
options: createObjectMatcher({
capture: { content: 'true', isStatic: false },
passive: { content: 'true', isStatic: false }
})
}),
persistent: { content: 'true', isStatic: false }
})
})
})
@@ -86,10 +83,10 @@ describe('compiler-dom: transform v-on', () => {
'["a"]'
]
},
persistent: { content: 'true', isStatic: false },
options: createObjectMatcher({
capture: { content: 'true', isStatic: false }
})
}),
persistent: { content: 'true', isStatic: false }
})
})
})