Skip to content

Commit

Permalink
fix(QRadio/QCheckbox): checked must be set as .prop to change the nat…
Browse files Browse the repository at this point in the history
…ive form value and as .attr to change the html attr #15182 (#15183)

close #15182
  • Loading branch information
pdanpdan committed Dec 28, 2022
1 parent da674c8 commit fd8d513
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ui/src/components/checkbox/use-checkbox.js
Expand Up @@ -112,6 +112,8 @@ export default function (type, getInner) {
const prop = { type: 'checkbox' }

props.name !== void 0 && Object.assign(prop, {
// see https://vuejs.org/guide/extras/render-function.html#creating-vnodes (.prop)
'.checked': isTrue.value,
'^checked': isTrue.value === true ? 'checked' : void 0,
name: props.name,
value: modelIsArray.value === true
Expand Down
2 changes: 2 additions & 0 deletions ui/src/components/radio/QRadio.js
Expand Up @@ -100,6 +100,8 @@ export default createComponent({
const prop = { type: 'radio' }

props.name !== void 0 && Object.assign(prop, {
// see https://vuejs.org/guide/extras/render-function.html#creating-vnodes (.prop)
'.checked': isTrue.value === true,
'^checked': isTrue.value === true ? 'checked' : void 0,
name: props.name,
value: props.val
Expand Down

0 comments on commit fd8d513

Please sign in to comment.