diff --git a/src/platforms/web/compiler/directives/model.js b/src/platforms/web/compiler/directives/model.js index 3a531fac..2c867887 100644 --- a/src/platforms/web/compiler/directives/model.js +++ b/src/platforms/web/compiler/directives/model.js @@ -114,8 +114,7 @@ function genDefaultModel ( type === 'file') { warn( `<${el.tag} v-model="${value}" type="file">:\n` + - 'File inputs are read only. You should use @change instead:\n' + - `<${el.tag} @change="${value} = $event.target.files" type="file">` + `File inputs are read only. Use a v-on:change listener instead.` ) } addProp(el, 'value', isNative ? `_s(${value})` : `(${value})`) diff --git a/test/unit/features/directives/model-file.spec.js b/test/unit/features/directives/model-file.spec.js index 2a6e5d2b..8c92ab72 100644 --- a/test/unit/features/directives/model-file.spec.js +++ b/test/unit/features/directives/model-file.spec.js @@ -8,6 +8,6 @@ describe('Directive v-model file', () => { }, template: '' }).$mount() - expect('use @change instead').toHaveBeenWarned() + expect('Use a v-on:change listener instead').toHaveBeenWarned() }) })