render() { const { filter, onChange } = this.props return ( <Radio.Group defaultValue={filter} onChange={onChange}> <Radio value="all">All</Radio> <Radio value="active">Active</Radio> <Radio value="completed">Completed</Radio> </Radio.Group> ); }
render() { const {getFieldDecorator, getFieldsError, getFieldError, isFieldTouched} = this.props.form; // Only show error after a field is touched. const usernameError = isFieldTouched('username') && getFieldError('username'); const passwordError = isFieldTouched('password') && getFieldError('password'); return ( <Row> <Col span={8} offset={8}> <Form layout="vertical" onSubmit={this.handleSubmit}> <Radio.Group defaultValue="horizontal" onChange={this.handleFormLayoutChange}> <Radio.Button value={FORM_LOGIN}>Signin</Radio.Button> <Radio.Button value={FORM_REGISTER}>Register</Radio.Button> </Radio.Group> <br/><br/> {this.state.showLoginForm ? <LoginForm/> : <RegisterForm/>} </Form> </Col> </Row> ); }
render() { return ( <IamViewByWrapper> {i18n('iam.viewBy')} <RadioGroup value={this.props.mode} onChange={(event) => this.changeMode(event.target.value) } > <RadioButton value="users"> {i18n('iam.users.label')} </RadioButton> <RadioButton value="roles"> {i18n('iam.roles.label')} </RadioButton> </RadioGroup> </IamViewByWrapper> ); }
function RadioBox(props) { const [Value, setValue] = useState(0); const renderRadioBox = () => props.list && props.list.map((value) => ( <Radio key={value._id} value={value._id}> {value.name} </Radio> )); const handleChange = (event) => { setValue(event.target.value); props.handleFilters(event.target.value); }; return ( <div> <Collapse defaultActiveKey={["0"]}> <Panel header="Price" key="1"> <Radio.Group onChange={handleChange} value={Value}> {renderRadioBox()} </Radio.Group> </Panel> </Collapse> </div> ); }
<Radio.Button value="default">Default</Radio.Button> <Radio.Button value="small">Small</Radio.Button> </Radio.Group> <br /><br /> <Button type="primary" size={size}>Primary</Button>
<Modal visible={visible} title="DIFF OPTIONS" footer={null} onCancel={onClose}> <Row title="View Mode" tooltip="You can choose to view diff in two columns or a unified column"> <RadioGroup size="small" value={viewType} onChange={e => onSwitchViewType(e.target.value)}> <RadioButton value="split">Split</RadioButton> <RadioButton value="unified">Unfiied</RadioButton> </Row> <Row title="Mark Edits" tooltip="Edits by block usually performs better in programming languages"> <RadioGroup size="small" value={editsType} onChange={e => onSwitchEditsType(e.target.value)}> <RadioButton value="none">None</RadioButton> <RadioButton value="line">Line</RadioButton>
function Component({ id, visible, data, onOK, onCancel, onChange }) { const handleChange = (e) => { console.log(e) onChange(e.target.value) } return ( <Modal title="选择栏目类型" width={700} visible={visible} onOk={onOK} onCancel={onCancel} > <Radio.Group onChange={handleChange} value={id}> <Row gutter={16}> {data.map((value, index) => <Col className={styles.card} span={6} key={index}> <img src={value.img_url} alt={value.value} /> <Radio disabled={false} value={value.key}>{value.value}</Radio> </Col>)} </Row> </Radio.Group> </Modal> ) }
form.getFieldDecorator('formType', { initialValue: formType, rules: [{ required: true, message: '请选择直播类型!' }], })( <Radio.Group onChange={handleChangeFormType}> {formTypes.map((values, index) => <Radio key={index} value={String(values.id)} disabled={!!(formId)} >{values.name}</Radio>) } </Radio.Group> )
mask={ false } onCancel={this.exportModalCancle}> <RadioGroup onChange={this.onRadioChange} value={ category }> <Radio value='DEFAULT'>首页</Radio> <Radio value='TRAVEL' >游记</Radio>
</FormItem> <FormItem label="版本控制类型:"> <RadioGroup {...getFieldProps('gender', { initialValue: 'svn' })}> <Radio value="svn">svn</Radio> <Radio value="git">git</Radio>
<RadioGroup id={name} onChange={(e) =>
<Radio value="1">是</Radio> <Radio value="2">否</Radio> </Radio.Group> )} </Form.Item>
<Radio.Button value='default'>Default</Radio.Button> <Radio.Button value='small'>Small</Radio.Button> </Radio.Group> </Row> <br />
<Radio.Button value="default">Default</Radio.Button> <Radio.Button value="small">Small</Radio.Button> </Radio.Group> <br /> <br />
function RadioBox(props) { const [Value, setValue] = useState(0); const renderRadioBox = () => props.list && props.list.map((value) => ( <Radio key={value._id} value={value._id}> {value.name} </Radio> )); const handleChange = (event) => { setValue(event.target.value); props.handleFilters(event.target.value); }; return ( <div> <Collapse defaultActiveKey={["0"]}> <Panel header="Price" key="1"> <Radio.Group onChange={handleChange} value={Value}> {renderRadioBox()} </Radio.Group> </Panel> </Collapse> </div> ); }