antd-mobile Picker组件默认值
import { createForm } from "rc-form";
@createForm()
class TopAdSlots extends Component {
@observable vs = [];
@action
handlePickerChange = vs => {
this.vs = vs;
};
render() {
const { getFieldProps } = this.props.form;
return (
<Picker
onOk={this.handlePickerChange}
data={this.area}
title="选择地区"
{...getFieldProps("district", {
initialValue: [this.vs],
})}
>
<Button color="primary">
地区<Icon>arrow_drop_down</Icon>
</Button>
</Picker>
);
}
}