diff --git a/.editorconfig b/.editorconfig index f1cc3ad329c..01a20f16fe3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# http://editorconfig.org +# https://editorconfig.org root = true diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 4ead0e1daf2..b39f08e2d28 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -2,7 +2,7 @@ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. -We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion. +We are committed to making participation in this project a harassment-free experience for everyone, regardless of the level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion. Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. diff --git a/.github/COMMIT_CONVENTION.md b/.github/COMMIT_CONVENTION.md index 02e7ad26ab1..381bf17baab 100644 --- a/.github/COMMIT_CONVENTION.md +++ b/.github/COMMIT_CONVENTION.md @@ -58,24 +58,24 @@ The **header** is mandatory and the **scope** of the header is optional. ### Revert -If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit .`, where the hash is the SHA of the commit being reverted. +If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body, it should say: `This reverts commit .`, where the hash is the SHA of the commit being reverted. ### Type -If the prefix is `feat`, `fix` or `perf`, it will appear in the changelog. However if there is any [BREAKING CHANGE](#footer), the commit will always appear in the changelog. +If the prefix is `feat`, `fix` or `perf`, it will appear in the changelog. However, if there is any [BREAKING CHANGE](#footer), the commit will always appear in the changelog. Other prefixes are up to your discretion. Suggested prefixes are `docs`, `chore`, `style`, `refactor`, and `test` for non-changelog related tasks. ### Scope -The scope could be anything specifying place of the commit change. For example `core`, `compiler`, `ssr`, `v-model`, `transition` etc... +The scope could be anything specifying the place of the commit change. For example `core`, `compiler`, `ssr`, `v-model`, `transition` etc... ### Subject -The subject contains succinct description of the change: +The subject contains a succinct description of the change: * use the imperative, present tense: "change" not "changed" nor "changes" -* don't capitalize first letter +* don't capitalize the first letter * no dot (.) at the end ### Body diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 7a01d7b58cd..5368b5481bc 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -24,23 +24,23 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before - Make sure `npm test` passes. (see [development setup](#development-setup)) -- If adding new feature: +- If adding a new feature: - Add accompanying test case. - - Provide convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it. + - Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it. - If fixing bug: - If you are resolving a special issue, add `(fix #xxxx[,#xxxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `update entities encoding/decoding (fix #3899)`. - - Provide detailed description of the bug in the PR. Live demo preferred. + - Provide a detailed description of the bug in the PR. Live demo preferred. - Add appropriate test coverage if applicable. ## Development Setup -You will need [Node.js](http://nodejs.org) **version 6+** and [Java Runtime Environment](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (for running Selenium server during e2e tests). +You will need [Node.js](http://nodejs.org) **version 8+**, [Java Runtime Environment](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (for running Selenium server during e2e tests) and [yarn](https://yarnpkg.com/en/docs/install). After cloning the repo, run: ``` bash -$ npm install # or yarn +$ yarn # install the dependencies of the project ``` ### Committing Changes @@ -59,7 +59,7 @@ $ npm run dev:test # build all dist files, including npm packages $ npm run build -# run the full test suite, include linting / type checking +# run the full test suite, including linting/type checking $ npm test ``` @@ -93,7 +93,7 @@ The default test script will do the following: lint with ESLint -> type check wi - **`core`**: contains universal, platform-agnostic runtime code. - The Vue 2.0 core is platform-agnostic. That is, code inside `core` is able to be run in any JavaScript environment, be it the browser, Node.js, or an embedded JavaScript runtime in native applications. + The Vue 2.0 core is platform-agnostic. That is, the code inside `core` is able to be run in any JavaScript environment, be it the browser, Node.js, or an embedded JavaScript runtime in native applications. - **`observer`**: contains code related to the reactivity system. @@ -124,14 +124,7 @@ The default test script will do the following: lint with ESLint -> type check wi ## Financial Contribution -As a pure community-driven project without major corporate backing, we also welcome financial contributions via Patreon and OpenCollective. - -- [Become a backer or sponsor on Patreon](https://www.patreon.com/evanyou) -- [Become a backer or sponsor on OpenCollective](https://opencollective.com/vuejs) - -### What's the difference between Patreon and OpenCollective funding? - -Funds donated via Patreon go directly to support Evan You's full-time work on Vue.js. Funds donated via OpenCollective are managed with transparent expenses and will be used for compensating work and expenses for core team members or sponsoring community events. Your name/logo will receive proper recognition and exposure by donating on either platform. +As a pure community-driven project without major corporate backing, we also welcome financial contributions via GitHub Sponsors and OpenCollective. Please consult the [Sponsor Page](https://vuejs.org/sponsor/) for more details. ## Credits diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000000..652c1192b7b --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,8 @@ +# These are supported funding model platforms + +github: [yyx990803, posva] +patreon: evanyou +open_collective: vuejs +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/vue +custom: # Replace with a single custom sponsorship URL diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index cb7f961992c..00000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,16 +0,0 @@ - - - diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000000..675eea91e7c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: false +contact_links: + - name: Create new issue + url: https://new-issue.vuejs.org/ + about: Please use the following link to create a new issue. + - name: Patreon + url: https://www.patreon.com/evanyou + about: Love Vue.js? Please consider supporting us via Patreon. + - name: Open Collective + url: https://opencollective.com/vuejs/donate + about: Love Vue.js? Please consider supporting us via Open Collective. diff --git a/BACKERS.md b/BACKERS.md index 3bbe5cb2a3d..fa66d206698 100644 --- a/BACKERS.md +++ b/BACKERS.md @@ -1,468 +1,9 @@

Sponsors & Backers

-Vue.js is an MIT-licensed open source project. It's an independent project with its ongoing development made possible entirely thanks to the support by these awesome [backers](https://github.com/vuejs/vue/blob/dev/BACKERS.md). If you'd like to join them, please consider: - -- [Become a backer or sponsor on Patreon](https://www.patreon.com/evanyou). -- [Become a backer or sponsor on OpenCollective](https://opencollective.com/vuejs). -- [One-time donation via PayPal or crypto-currencies.](https://vuejs.org/support-vuejs/#One-time-Donations) - -#### What's the difference between Patreon and OpenCollective? - -Funds donated via Patreon go directly to support Evan You's full-time work on Vue.js. Funds donated via OpenCollective are managed with transparent expenses and will be used for compensating work and expenses for core team members or sponsoring community events. Your name/logo will receive proper recognition and exposure by donating on either platform. - -

- -

Special Sponsors

- - +Vue.js is an MIT-licensed open source project with its ongoing development made possible entirely by the support of the awesome sponsors and backers listed in this file. If you'd like to join them, please consider [ sponsor Vue's development](https://vuejs.org/sponsor/).

- - + + sponsors

- - - -

Platinum via Patreon

- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - - -
- - - -

Platinum Sponsors (China)

- - - - - - -
- - - -
- - -

Platinum via OpenCollective

- - - - -

Gold via Patreon

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - -

Gold via OpenCollective

- - - - - - - - - - - - - -

Silver via Patreon

- -- Matt Mullenweg - - - - - - - - - -
- - - - - - - -
- - -

Silver via OpenCollective

- - - - - -

Bronze via Patreon

- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - -

Bronze via OpenCollective

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Generous Backers via Patreon ($50+)

- - -- Jamie K -- Wasim Khamlichi -- errorrik -- Alex Balashov -- Konstantin Levinski -- Blaise Laflamme -- Ernest Sim -- Dilettant -- Sean Ferguson - - -

Backers via Patreon

- - -- Masahiro Tanaka -- Shawn Wildermuth -- Samuel Smith -- donny -- Jake Ingman -- Simon East -- kazupon -- Lars Andreas Ness -- Luca Borghini -- Sean Washington -- Benjamin Listwon -- Keisuke Kita -- Kirk Lewis -- Wen-Tien Chang -- Victor Tolbert -- Stephen Michael Hartley -- Karol -- Phan An -- Miljan Aleksic -- James J. Ye -- Barbara Liau -- Luiz -- Matsumoto Takamasa -- Jarek Tkaczyk -- Duncan Kenzie -- Mike Margerum -- Guy Gavergun -- Matt Jones -- Niannian Modisette -- Bernhard E. Reiter -- Pierre Vanhulst -- Zoran Knezevic -- Chengzhi Yin -- Shinya Katayama -- Jon Hobbs-Smith -- Anthony Estebe -- Asaf Yishai -- Haim Yulzari -- Akiho Nagao -- Jeremy Tan -- Jim Raden -- Tai Shi Ling -- IMGNRY -- Yong Jun Thong -- Matias Verdier -- Chih-Hsuan Fan -- Tyler -- Daniel Waghorn -- Vivekanandhan Natarajan -- Rafael Belvederese -- Jamie McElwain -- Cliff Hess -- Rob Yedlin -- Mickaël Andrieu -- Guilherme S L de Souza -- Jordan Oroshiba -- Joe Gregory -- Marcos Moura -- RADD Creative -- Richard Simpson -- Alok Pant -- Jessie Hernandez -- Ivan Sieder -- Aparajita Fishman -- Eric -- Christo Crampton -- Romain Lienard -- Bohdan Kokotko -- Donald Fischer -- Jere Sjöroos -- David Ang -- Alexander Weiher -- Oskar Lindgren -- Jaeyoung Lee -- Wakana Seki -- Ben Hong -- John Cleveland -- Tom Ootes -- Domenico Gaudioso -- David Kaplan -- Amor -- Andy -- Hannes Kochniß -- Juan Bermudez -- Daniel Mattingley -- Matt Sencenbaugh -- Joe Cochran -- Chris Calo -- Colt Borg -- Teon Ooi -- Alberto T. Payero Mota -- Elon Hung -- Milan Zivkovic -- Johnny Ray Austin -- Tom Meagher -- Soichiro Isshiki -- Abraham Arango -- Marko Boskovic -- Garion Herman -- Ed Linklater -- Christopher Bemister -- Andrew Willis -- Princeyesuraj Edward -- Yusuke Kawabata -- We -- Carlos Adrián -- Nick Dandakis -- shimbaco -- 极 蔡 -- 龙腾道 -- alcalbg -- Kenneth Crawford -- Peter Matkovsky -- Fabien GuySake Ungerer -- Kevin Batdorf -- Masato Miura -- Fedor Indutny -- Juli A Schlack - - -

Backers via OpenCollective

- - diff --git a/README.md b/README.md index 51f327e794b..ed68ab8bbbc 100644 --- a/README.md +++ b/README.md @@ -1,238 +1,27 @@

Vue logo

- Build Status - Coverage Status - Downloads - Version - License - Chat -
- Build Status + Build Status + Coverage Status + Downloads + Version + License + Chat

-

Supporting Vue.js

+## This repo is for Vue 2 -Vue.js is an MIT-licensed open source project with its ongoing development made possible entirely by the support of these awesome [backers](https://github.com/vuejs/vue/blob/dev/BACKERS.md). If you'd like to join them, please consider: +You are looking at the repository for Vue 2. The repo for Vue 3 is [vuejs/core](https://github.com/vuejs/core). -- [Become a backer or sponsor on Patreon](https://www.patreon.com/evanyou). -- [Become a backer or sponsor on Open Collective](https://opencollective.com/vuejs). -- [One-time donation via PayPal or crypto-currencies.](https://vuejs.org/support-vuejs/#One-time-Donations) +## Sponsors -#### What's the difference between Patreon and OpenCollective? - -Funds donated via Patreon go directly to support Evan You's full-time work on Vue.js. Funds donated via OpenCollective are managed with transparent expenses and will be used for compensating work and expenses for core team members or sponsoring community events. Your name/logo will receive proper recognition and exposure by donating on either platform. - -

Special Sponsors

- +Vue.js is an MIT-licensed open source project with its ongoing development made possible entirely by the support of these awesome [backers](https://github.com/vuejs/core/blob/main/BACKERS.md). If you'd like to join them, please consider [ sponsor Vue's development](https://vuejs.org/sponsor/).

- - + + sponsors

- - - -

Platinum Sponsors

- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - - -
- - - -

Platinum Sponsors (China)

- - - - - - -
- - - -
- - -

Gold Sponsors

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - -

Sponsors via Open Collective

- -

Platinum

- - - - -

Gold

- - - - - - --- @@ -242,20 +31,20 @@ Vue (pronounced `/vjuː/`, like view) is a **progressive framework** for buildin #### Browser Compatibility -Vue.js supports all browsers that are [ES5-compliant](http://kangax.github.io/compat-table/es5/) (IE8 and below are not supported). +Vue.js supports all browsers that are [ES5-compliant](https://kangax.github.io/compat-table/es5/) (IE8 and below are not supported). ## Ecosystem -| Project | Status | Description | -|---------|--------|-------------| -| [vue-router] | [![vue-router-status]][vue-router-package] | Single-page application routing | -| [vuex] | [![vuex-status]][vuex-package] | Large-scale state management | -| [vue-cli] | [![vue-cli-status]][vue-cli-package] | Project scaffolding | -| [vue-loader] | [![vue-loader-status]][vue-loader-package] | Single File Component (`*.vue` file) loader for webpack | -| [vue-server-renderer] | [![vue-server-renderer-status]][vue-server-renderer-package] | Server-side rendering support | -| [vue-class-component] | [![vue-class-component-status]][vue-class-component-package] | TypeScript decorator for a class-based API | -| [vue-rx] | [![vue-rx-status]][vue-rx-package] | RxJS integration | -| [vue-devtools] | [![vue-devtools-status]][vue-devtools-package] | Browser DevTools extension | +| Project | Status | Description | +| --------------------- | ------------------------------------------------------------ | ------------------------------------------------------- | +| [vue-router] | [![vue-router-status]][vue-router-package] | Single-page application routing | +| [vuex] | [![vuex-status]][vuex-package] | Large-scale state management | +| [vue-cli] | [![vue-cli-status]][vue-cli-package] | Project scaffolding | +| [vue-loader] | [![vue-loader-status]][vue-loader-package] | Single File Component (`*.vue` file) loader for webpack | +| [vue-server-renderer] | [![vue-server-renderer-status]][vue-server-renderer-package] | Server-side rendering support | +| [vue-class-component] | [![vue-class-component-status]][vue-class-component-package] | TypeScript decorator for a class-based API | +| [vue-rx] | [![vue-rx-status]][vue-rx-package] | RxJS integration | +| [vue-devtools] | [![vue-devtools-status]][vue-devtools-package] | Browser DevTools extension | [vue-router]: https://github.com/vuejs/vue-router [vuex]: https://github.com/vuejs/vuex @@ -264,8 +53,7 @@ Vue.js supports all browsers that are [ES5-compliant](http://kangax.github.io/co [vue-server-renderer]: https://github.com/vuejs/vue/tree/dev/packages/vue-server-renderer [vue-class-component]: https://github.com/vuejs/vue-class-component [vue-rx]: https://github.com/vuejs/vue-rx -[vue-devtools]: https://github.com/vuejs/vue-devtools - +[vue-devtools]: https://github.com/vuejs/vue-devtools [vue-router-status]: https://img.shields.io/npm/v/vue-router.svg [vuex-status]: https://img.shields.io/npm/v/vuex.svg [vue-cli-status]: https://img.shields.io/npm/v/@vue/cli.svg @@ -274,7 +62,6 @@ Vue.js supports all browsers that are [ES5-compliant](http://kangax.github.io/co [vue-class-component-status]: https://img.shields.io/npm/v/vue-class-component.svg [vue-rx-status]: https://img.shields.io/npm/v/vue-rx.svg [vue-devtools-status]: https://img.shields.io/chrome-web-store/v/nhdogjmejiglipccpnnnanhbledajbpd.svg - [vue-router-package]: https://npmjs.com/package/vue-router [vuex-package]: https://npmjs.com/package/vuex [vue-cli-package]: https://npmjs.com/package/@vue/cli @@ -290,7 +77,7 @@ To check out [live examples](https://vuejs.org/v2/examples/) and docs, visit [vu ## Questions -For questions and support please use [the official forum](http://forum.vuejs.org) or [community chat](https://chat.vuejs.org/). The issue list of this repo is **exclusively** for bug reports and feature requests. +For questions and support please use [the official forum](https://forum.vuejs.org) or [community chat](https://chat.vuejs.org/). The issue list of this repo is **exclusively** for bug reports and feature requests. ## Issues @@ -314,9 +101,8 @@ Thank you to all the people who already contributed to Vue! - ## License -[MIT](http://opensource.org/licenses/MIT) +[MIT](https://opensource.org/licenses/MIT) Copyright (c) 2013-present, Yuxi (Evan) You diff --git a/benchmarks/ssr/README.md b/benchmarks/ssr/README.md index 2f0529c1fd8..c61d6daa57d 100644 --- a/benchmarks/ssr/README.md +++ b/benchmarks/ssr/README.md @@ -2,7 +2,7 @@ This benchmark renders a table of 1000 rows with 10 columns (10k components), with around 30k normal elements on the page. Note this is not something likely to be seen in a typical app. This benchmark is mostly for stress/regression testing and comparing between `renderToString` and `renderToStream`. -To view the results follow the run section. Note that the overall completion time for the results are variable, this is due to other system related variants at run time (available memory, processing power, etc). In ideal circumstances both should finish within similar results. +To view the results follow the run section. Note that the overall completion time for the results is variable, this is due to other system related variants at run time (available memory, processing power, etc). In ideal circumstances, both should finish within similar results. `renderToStream` pipes the content through a stream which provides considerable performance benefits (faster time-to-first-byte and non-event-loop-blocking) over `renderToString`. This can be observed through the benchmark. diff --git a/benchmarks/uptime/index.html b/benchmarks/uptime/index.html index 4a375152cf2..d43c93010a6 100644 --- a/benchmarks/uptime/index.html +++ b/benchmarks/uptime/index.html @@ -38,7 +38,7 @@ .days { display: flex; flex-direction: row; - flex-flow: wrap; + flex-wrap: wrap; } .uptime-day { @@ -82,7 +82,7 @@ ' + } + } + }).$mount() + expect(vm.$el.nodeName).toBe('#comment') + expect('Templates should only be responsible for mapping the state').toHaveBeenWarned() + }) }) diff --git a/test/unit/features/directives/bind.spec.js b/test/unit/features/directives/bind.spec.js index 3d29c984369..7e4827dc061 100644 --- a/test/unit/features/directives/bind.spec.js +++ b/test/unit/features/directives/bind.spec.js @@ -234,7 +234,7 @@ describe('Directive v-bind', () => { template: ``, components: { test: { - template: '
', + template: '
{{ dataFoo }} {{ dataBar }}
', props: ['dataFoo', 'dataBar'] } }, @@ -245,8 +245,7 @@ describe('Directive v-bind', () => { } } }).$mount() - expect(vm.$el.getAttribute('data-foo')).toBe('foo') - expect(vm.$el.getAttribute('data-bar')).toBe('bar') + expect(vm.$el.textContent).toBe('foo bar') }) it('.sync modifier with bind object', done => { diff --git a/test/unit/features/directives/class.spec.js b/test/unit/features/directives/class.spec.js index 0ee3380ca9a..38a25988d2a 100644 --- a/test/unit/features/directives/class.spec.js +++ b/test/unit/features/directives/class.spec.js @@ -152,6 +152,39 @@ describe('Directive v-bind:class', () => { }).then(done) }) + // css static classes should only contain a single space in between, + // as all the text inside of classes is shipped as a JS string + // and this could lead to useless spacing in static classes + it('condenses whitespace in staticClass', done => { + const vm = new Vue({ + template: '
', + }).$mount() + expect(vm.$el.className).toBe('test1 test2 test3 test4 test5 test6') + done() + }) + + it('condenses whitespace in staticClass merge in a component', done => { + const vm = new Vue({ + template: ` + + + `, + data: { + componentClass1: 'componentClass1', + }, + components: { + component1: { + template: '
' + }, + } + }).$mount() + expect(vm.$el.className).toBe('test staticClass componentClass1') + vm.componentClass1 = 'c1' + waitForUpdate(() => { + expect(vm.$el.className).toBe('test staticClass c1') + }).then(done) + }) + // a vdom patch edge case where the user has several un-keyed elements of the // same tag next to each other, and toggling them. it('properly remove staticClass for toggling un-keyed children', done => { diff --git a/test/unit/features/directives/on.spec.js b/test/unit/features/directives/on.spec.js index a97ddaa8947..353d3df5372 100644 --- a/test/unit/features/directives/on.spec.js +++ b/test/unit/features/directives/on.spec.js @@ -31,7 +31,7 @@ describe('Directive v-on', () => { expect(event.type).toBe('click') }) - it('should bind event to a inline statement', () => { + it('should bind event to an inline statement', () => { vm = new Vue({ el, template: '
', @@ -218,7 +218,7 @@ describe('Directive v-on', () => { }) // ctrl, shift, alt, meta - it('should support system modifers', () => { + it('should support system modifiers', () => { vm = new Vue({ el, template: ` @@ -280,7 +280,7 @@ describe('Directive v-on', () => { expect(spy.calls.count()).toBe(1) }) - it('should support system modifers with exact', () => { + it('should support system modifiers with exact', () => { vm = new Vue({ el, template: ` @@ -405,7 +405,7 @@ describe('Directive v-on', () => { Vue.config.keyCodes = Object.create(null) }) - it('should override build-in keyCode', () => { + it('should override built-in keyCode', () => { Vue.config.keyCodes.up = [1, 87] vm = new Vue({ el, @@ -420,7 +420,7 @@ describe('Directive v-on', () => { e.keyCode = 1 }) expect(spy).toHaveBeenCalledTimes(2) - // should not affect build-in down keycode + // should not affect built-in down keycode triggerEvent(vm.$el, 'keyup', e => { e.keyCode = 40 }) @@ -460,6 +460,34 @@ describe('Directive v-on', () => { expect(spy).toHaveBeenCalled() }) + it('should throw a warning if native modifier is used on native HTML element', () => { + 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