Radio: fix console error of RadioGroup

pull/8136/head
Leopoldthecoder 2017-11-09 15:12:37 +08:00 committed by 杨奕
parent cbfd9cfab3
commit aa02b42022
1 changed files with 4 additions and 3 deletions

View File

@ -53,9 +53,10 @@
},
mounted() {
// radioGroupTab
let radios = this.$el.querySelectorAll('[type=radio]');
if (![].some.call(radios, radio => radio.checked)) {
this.$el.querySelectorAll('[role=radio]')[0].tabIndex = 0;
const radios = this.$el.querySelectorAll('[type=radio]');
const firstLabel = this.$el.querySelectorAll('[role=radio]')[0];
if (![].some.call(radios, radio => radio.checked) && firstLabel) {
firstLabel.tabIndex = 0;
}
},
methods: {