Skip to content

Commit 310f5a2

Browse files
committed
tweak v-model type=file warning phrasing
1 parent b8095bf commit 310f5a2

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/platforms/web/compiler/directives/model.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ function genDefaultModel (
114114
type === 'file') {
115115
warn(
116116
`<${el.tag} v-model="${value}" type="file">:\n` +
117-
'File inputs are read only. You should use @change instead:\n' +
118-
`<${el.tag} @change="${value} = $event.target.files" type="file">`
117+
`File inputs are read only. Use a v-on:change listener instead.`
119118
)
120119
}
121120
addProp(el, 'value', isNative ? `_s(${value})` : `(${value})`)

test/unit/features/directives/model-file.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ describe('Directive v-model file', () => {
88
},
99
template: '<input v-model="file" type="file">'
1010
}).$mount()
11-
expect('use @change instead').toHaveBeenWarned()
11+
expect('Use a v-on:change listener instead').toHaveBeenWarned()
1212
})
1313
})

0 commit comments

Comments
 (0)