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>
    );
  }
}
posted @ 2018-12-19 19:48  Ajanuw  阅读(2088)  评论(0编辑  收藏  举报