Browse Source

radio-label值获取方法修改

pull/105/head
zq 3 weeks ago
parent
commit
82f3f22ac4
  1. 14
      src/components/GuipRadio.vue

14
src/components/GuipRadio.vue

@ -138,10 +138,16 @@ export default {
// //
const isSelected = this.getValue(option) === this.selectedValue; const isSelected = this.getValue(option) === this.selectedValue;
// selectedLabellabelKey // selectedLabel
return isSelected && option[this.selectedLabelKey] if (isSelected && option[this.selectedLabelKey]) {
? option[this.selectedLabelKey] return option[this.selectedLabelKey];
: option[this.labelKey] || option; }
// labelKey
if (typeof option === 'object' && this.labelKey in option) {
return option[this.labelKey];
}
return option;
}, },
getValue(option) { getValue(option) {
// //

Loading…
Cancel
Save