From e3b2bd542d6815e527b22ed58b3cf6613c358af9 Mon Sep 17 00:00:00 2001 From: Andrzej Swaton Date: Fri, 24 Jan 2020 19:14:58 +0100 Subject: [PATCH 1/2] do not warn about .native modifier for .`, context From 225978c1d587e3eeafb84885f979842bb6a36975 Mon Sep 17 00:00:00 2001 From: Andrzej Swaton Date: Mon, 27 Jan 2020 12:03:58 +0100 Subject: [PATCH 2/2] test for not warning about .native modifier on component tags --- test/unit/features/directives/on.spec.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/unit/features/directives/on.spec.js b/test/unit/features/directives/on.spec.js index b7801a82f22..d4774b0846f 100644 --- a/test/unit/features/directives/on.spec.js +++ b/test/unit/features/directives/on.spec.js @@ -474,6 +474,20 @@ describe('Directive v-on', () => { expect(spy.calls.count()).toBe(0) }) + it('should not throw a warning if native modifier is used on a dynamic component', () => { + vm = new Vue({ + el, + template: ` + + `, + methods: { foo: spy }, + }) + + triggerEvent(vm.$el, 'click') + expect(`The .native modifier for v-on is only valid on components but it was used on
.`).not.toHaveBeenWarned() + expect(spy.calls.allArgs()).toEqual([['regular']]); // Regular @click should work for dynamic components resolved to native HTML elements. + }) + it('.once modifier should work with child components', () => { vm = new Vue({ el,