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(
`'${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
);
}
} else if (name === 'group') {
if (node.name !== 'input') {
validator.error(
@ -129,7 +132,7 @@ export default function validateElement(
if (type !== 'checkbox' && type !== 'radio') {
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
);
}

@ -1,8 +1,8 @@
[{
"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": {
"line": 1,
"column": 7
},
"pos": 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