Skip to content

Popup和Picker结合使用时,.getValue()报错,picker对象中没有此方法? this.props.onOk!(this.picker && this.picker.getValue()) #66

Description

@slsay

PopupMixin.tsx line:116

Popup和Picker结合使用时,.getValue()报错,picker对象中没有此方法?

import Picker from 'rmc-picker/lib/Picker'
import PopPicker from "rmc-picker/lib/Popup";

...
    const items = ["1", "2", "3", "4", "5" ,"6" ,"7"];
    const popupContent = (
      <Picker
      >
        {
          items.map((item) => {
            return <Picker.Item value={item} key={generateUUID()}>
            {item}
            </Picker.Item>
          })
        }
      </Picker>
    );
    
   const picker = (
        <PopPicker
          transitionName="rmc-picker-popup-slide-fade"
          maskTransitionName="rmc-picker-popup-fade"
          picker={popupContent}
          okText="OK"
          dismissText="取消"
          title="选择"
          value={value}
          pickerValueChangeProp="onValueChange"
          pickerValueProp="selectedValue"
          onOk={this.handleSelectChange}
        >
          <div >
            <div >
              <span>{value}</span>
              <span>
                <Icon type="down" theme="outlined" />
              </span>
            </div>
          </div>
        </PopPicker>
);
...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions