jiaqingjiayi-xiaochengxu/甲情_甲意/node_modules/antd-mini/less/Radio/RadioGroup/index.js

17 lines
600 B
JavaScript
Raw Normal View History

2024-11-15 03:51:28 +00:00
import { Component, triggerEvent, getValueFromProps } from '../../_util/simply';
import { RadioGroupDefaultProps } from './props';
import mixinValue from '../../mixins/value';
Component(RadioGroupDefaultProps, {
onChange: function (_, e) {
var event;
event = e;
var index = event.currentTarget.dataset.index;
var options = getValueFromProps(this, 'options');
var value = options[index].value;
if (!this.isControlled()) {
this.update(value);
}
triggerEvent(this, 'change', value, event);
},
}, null, [mixinValue()]);