Support for <input type="radio" bind:checked/>

fixed #1104
pull/1141/head
Denis Kurilenko 8 years ago
parent 56e9343294
commit ba24de4e10

@ -111,12 +111,15 @@ export default function validateElement(
); );
} }
if (checkTypeAttribute(validator, node) !== 'checkbox') { const type = checkTypeAttribute(validator, node);
if (type !== 'checkbox' && type !== 'radio') {
validator.error( validator.error(
`'${name}' binding can only be used with <input type="checkbox">`, `'checked' binding can only be used with <input type="checkbox"> or <input type="radio">`,
attribute.start attribute.start
); );
} }
} else if (name === 'group') { } else if (name === 'group') {
if (node.name !== 'input') { if (node.name !== 'input') {
validator.error( validator.error(
@ -129,7 +132,7 @@ export default function validateElement(
if (type !== 'checkbox' && type !== 'radio') { if (type !== 'checkbox' && type !== 'radio') {
validator.error( validator.error(
`'checked' binding can only be used with <input type="checkbox"> or <input type="radio">`, `'group' binding can only be used with <input type="checkbox"> or <input type="radio">`,
attribute.start attribute.start
); );
} }

@ -1,5 +1,5 @@
[{ [{
"message": "'checked' binding can only be used with <input type=\"checkbox\">", "message": "'checked' binding can only be used with <input type=\"checkbox\"> or <input type=\"radio\">",
"loc": { "loc": {
"line": 1, "line": 1,
"column": 7 "column": 7

@ -0,0 +1,8 @@
[{
"message": "'group' binding can only be used with <input type=\"checkbox\"> or <input type=\"radio\">",
"loc": {
"line": 1,
"column": 7
},
"pos": 7
}]
Loading…
Cancel
Save