From 310f5a2f5f18b549c37299d92e368184c3111034 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 27 Sep 2016 15:51:46 -0400 Subject: [PATCH] tweak v-model type=file warning phrasing --- src/platforms/web/compiler/directives/model.js | 3 +-- test/unit/features/directives/model-file.spec.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) 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() }) })