|
@@ -21,7 +21,6 @@ export default function model (
|
|
|
const modifiers = dir.modifiers
|
|
const modifiers = dir.modifiers
|
|
|
const tag = el.tag
|
|
const tag = el.tag
|
|
|
const type = el.attrsMap.type
|
|
const type = el.attrsMap.type
|
|
|
- const attrsMap = el.attrsMap
|
|
|
|
|
|
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
|
// inputs with type="file" are read only and setting the input's
|
|
// inputs with type="file" are read only and setting the input's
|
|
@@ -32,20 +31,6 @@ export default function model (
|
|
|
`File inputs are read only. Use a v-on:change listener instead.`
|
|
`File inputs are read only. Use a v-on:change listener instead.`
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // warn if v-bind:value conflicts with v-model
|
|
|
|
|
- if (
|
|
|
|
|
- (attrsMap['v-bind:value'] || attrsMap[':value']) &&
|
|
|
|
|
- type !== 'checkbox' &&
|
|
|
|
|
- type !== 'radio' &&
|
|
|
|
|
- tag !== 'select'
|
|
|
|
|
- ) {
|
|
|
|
|
- const vBindValue = attrsMap['v-bind:value'] ? 'v-bind:value' : ':value'
|
|
|
|
|
- warn(
|
|
|
|
|
- `${vBindValue} conflicts with v-model on the same element ` +
|
|
|
|
|
- 'because the latter already expands to a value binding internally'
|
|
|
|
|
- )
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (el.component) {
|
|
if (el.component) {
|
|
@@ -143,6 +128,19 @@ function genDefaultModel (
|
|
|
modifiers: ?ASTModifiers
|
|
modifiers: ?ASTModifiers
|
|
|
): ?boolean {
|
|
): ?boolean {
|
|
|
const type = el.attrsMap.type
|
|
const type = el.attrsMap.type
|
|
|
|
|
+
|
|
|
|
|
+ // warn if v-bind:value conflicts with v-model
|
|
|
|
|
+ if (process.env.NODE_ENV !== 'production') {
|
|
|
|
|
+ const value = el.attrsMap['v-bind:value'] || el.attrsMap[':value']
|
|
|
|
|
+ if (value) {
|
|
|
|
|
+ const binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value'
|
|
|
|
|
+ warn(
|
|
|
|
|
+ `${binding}="${value}" conflicts with v-model on the same element ` +
|
|
|
|
|
+ 'because the latter already expands to a value binding internally'
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const { lazy, number, trim } = modifiers || {}
|
|
const { lazy, number, trim } = modifiers || {}
|
|
|
const needCompositionGuard = !lazy && type !== 'range'
|
|
const needCompositionGuard = !lazy && type !== 'range'
|
|
|
const event = lazy
|
|
const event = lazy
|