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

View file

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