diff --git a/docs/rules/valid-v-model.md b/docs/rules/valid-v-model.md index 62f3e4545..fd1ff5097 100644 --- a/docs/rules/valid-v-model.md +++ b/docs/rules/valid-v-model.md @@ -11,7 +11,6 @@ This rule reports `v-model` directives in the following cases: - The directive does not have that attribute value. E.g. `` - The directive does not have the attribute value which is valid as LHS. E.g. `` - The directive is on unsupported elements. E.g. `
` -- The directive is on `` elements which their types are dynamic. E.g. `` - The directive is on `` elements which their types are `file`. E.g. `` - The directive's reference is iteration variables. E.g. `` diff --git a/lib/rules/valid-v-model.js b/lib/rules/valid-v-model.js index a0620ecd5..420212f70 100644 --- a/lib/rules/valid-v-model.js +++ b/lib/rules/valid-v-model.js @@ -93,23 +93,14 @@ function create (context) { data: { name } }) } - if (name === 'input') { - if (utils.hasDirective(element, 'bind', 'type')) { - context.report({ - node, - loc: node.loc, - message: "'v-model' directives don't support dynamic input types.", - data: { name } - }) - } - if (utils.hasAttribute(element, 'type', 'file')) { - context.report({ - node, - loc: node.loc, - message: "'v-model' directives don't support 'file' input type.", - data: { name } - }) - } + + if (name === 'input' && utils.hasAttribute(element, 'type', 'file')) { + context.report({ + node, + loc: node.loc, + message: "'v-model' directives don't support 'file' input type.", + data: { name } + }) } if (node.key.argument) { diff --git a/tests/lib/rules/valid-v-model.js b/tests/lib/rules/valid-v-model.js index ac7039a90..459ec7d3d 100644 --- a/tests/lib/rules/valid-v-model.js +++ b/tests/lib/rules/valid-v-model.js @@ -66,6 +66,14 @@ tester.run('valid-v-model', rule, { { filename: 'test.vue', code: '