import baseComponent from '../helpers/baseComponent' import classNames from '../helpers/classNames' baseComponent({ useField: true, relations: { '../radio/index': { type: 'child', observer() { this.debounce(this.changeValue) }, }, }, properties: { prefixCls: { type: String, value: 'wux-radio-group', }, cellGroupPrefixCls: { type: String, value: 'wux-cell-group', }, value: { type: String, value: '', observer: 'changeValue', }, title: { type: String, value: '', }, label: { type: String, value: '', }, }, methods: { changeValue(value = this.data.value) { const elements = this.getRelationNodes('../radio/index') if (elements.length > 0) { elements.forEach((element, index) => { element.changeValue(value === element.data.value, index) }) } }, emitEvent(item) { this.triggerEvent('change', { ...item, name: this.data.name }) }, }, })