forked from alibaba-fusion/next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
radio-item.jsx
47 lines (43 loc) · 1.13 KB
/
radio-item.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import CheckableItem from './checkable-item';
/**
* Menu.RadioItem
* @order 4
* @description 该子组件选中情况不受 defaultSelectedKeys/selectedKeys 控制,请自行控制选中逻辑
*/
export default class RadioItem extends Component {
static menuChildType = 'item';
static propTypes = {
/**
* 是否选中
*/
checked: PropTypes.bool,
/**
* 是否禁用
*/
disabled: PropTypes.bool,
/**
* 选中或取消选中触发的回调函数
* @param {Boolean} checked 是否选中
* @param {Object} event 选中事件对象
*/
onChange: PropTypes.func,
/**
* 帮助文本
*/
helper: PropTypes.node,
/**
* 标签内容
*/
children: PropTypes.node
};
static defaultProps = {
checked: false,
disabled: false,
onChange: () => {}
};
render() {
return <CheckableItem role="menuitemradio" checkType="radio" {...this.props} />;
}
}