fix(compiler-core): generate NEED_PATCH flag for element with vnode hooks

This commit is contained in:
Evan You
2020-08-19 17:29:23 -04:00
parent c2913d57d1
commit 24041b7ac1
2 changed files with 19 additions and 4 deletions

View File

@@ -780,6 +780,11 @@ describe('compiler: element transform', () => {
expect(node.patchFlag).toBe(genFlagText(PatchFlags.NEED_PATCH))
})
test('NEED_PATCH (vnode hooks)', () => {
const { node } = parseWithBind(`<div @vnodeUpdated="foo" />`)
expect(node.patchFlag).toBe(genFlagText(PatchFlags.NEED_PATCH))
})
test('HYDRATE_EVENTS', () => {
// ignore click events (has dedicated fast path)
const { node } = parseWithElementTransform(`<div @click="foo" />`, {