This commit is contained in:
梁灏 2021-09-15 16:46:50 +08:00
parent 1582a8b1c6
commit 7cfd6df3f7
2 changed files with 7 additions and 7 deletions

View file

@ -53,7 +53,7 @@
data () { data () {
return { return {
currentValue: this.value, currentValue: this.value,
childrens: [] children: []
}; };
}, },
computed: { computed: {
@ -75,9 +75,9 @@
}, },
methods: { methods: {
updateValue () { updateValue () {
this.childrens = findComponentsDownward(this, 'Radio'); this.children = findComponentsDownward(this, 'Radio');
if (this.childrens) { if (this.children) {
this.childrens.forEach(child => { this.children.forEach(child => {
child.currentValue = this.currentValue === child.label; child.currentValue = this.currentValue === child.label;
child.group = true; child.group = true;
}); });

View file

@ -193,11 +193,11 @@ export {findComponentUpward};
// Find component downward // Find component downward
export function findComponentDownward (context, componentName) { export function findComponentDownward (context, componentName) {
const childrens = context.$children; const $children = context.$children;
let children = null; let children = null;
if (childrens.length) { if ($children.length) {
for (const child of childrens) { for (const child of $children) {
const name = child.$options.name; const name = child.$options.name;
if (name === componentName) { if (name === componentName) {
children = child; children = child;