diff --git a/src/core/vdom/helpers/normalize-scoped-slots.js b/src/core/vdom/helpers/normalize-scoped-slots.js index aa78838e..fcb2fcbf 100644 --- a/src/core/vdom/helpers/normalize-scoped-slots.js +++ b/src/core/vdom/helpers/normalize-scoped-slots.js @@ -26,7 +26,7 @@ export function normalizeScopedSlots ( } } res._normalized = true - res.$stable = slots && slots.$stable + res.$stable = slots ? slots.$stable : true return res } diff --git a/test/unit/modules/vdom/patch/edge-cases.spec.js b/test/unit/modules/vdom/patch/edge-cases.spec.js index a1c492d4..dd8895bc 100644 --- a/test/unit/modules/vdom/patch/edge-cases.spec.js +++ b/test/unit/modules/vdom/patch/edge-cases.spec.js @@ -410,4 +410,27 @@ describe('vdom patch: edge cases', () => { expect(vm.$el.textContent).toBe('FooBar') expect(inlineHookSpy.calls.count()).toBe(2) }) + + // regression #9396 + it('should not force update child with no slot content', done => { + const Child = { + updated: jasmine.createSpy(), + template: `
` + } + + const parent = new Vue({ + template: `
{{ count }}
`, + data: { + count: 0 + }, + components: { Child } + }).$mount() + + expect(parent.$el.textContent).toBe(`0`) + parent.count++ + waitForUpdate(() => { + expect(parent.$el.textContent).toBe(`1`) + expect(Child.updated).not.toHaveBeenCalled() + }).then(done) + }) })