Skip to content

Commit

Permalink
tweak v-model type=file warning phrasing
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Sep 27, 2016
1 parent b8095bf commit 310f5a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/platforms/web/compiler/directives/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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})`)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/features/directives/model-file.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ describe('Directive v-model file', () => {
},
template: '<input v-model="file" type="file">'
}).$mount()
expect('use @change instead').toHaveBeenWarned()
expect('Use a v-on:change listener instead').toHaveBeenWarned()
})
})

0 comments on commit 310f5a2

Please sign in to comment.