zoukankan      html  css  js  c++  java
  • antd 给select下拉框添加懒加载

    给select下拉框添加属性

    dropdownRender={menu => (
                                    <div>
                                      {menu}
                                      <div
                                        className="selectScroll"
                                        style={{ textAlign: 'center' }}
                                        onMouseDown={e => e.preventDefault()}
                                      >
                                        {
                                          selectLoading && // 加载状态
                                            <Spin size="small" style={{ padding: '8px' }} />
                                        }
                                      </div>
                                    </div>
                                  )}
    onPopupScroll={this.companyScroll }
    companyScroll = (e) => {
        const { clientHeight, scrollHeight, scrollTop } = e.target;
        const { pageTotal, selectLoading } = this.state;
        if ((clientHeight + scrollTop === scrollHeight) && !selectLoading) {
          this.setState({
            selectCurPage: this.state.selectCurPage + 1,
          }, () => {
            if (Math.ceil(pageTotal / 15) >= this.state.selectCurPage) {
              // 获取数据的接口
            }
          });
        }
      }
  • 相关阅读:
    正睿提高组2017模拟题三T1
    数位dp【转载】
    正睿提高组2017模拟题二T2
    【树状数组二维区间加+区间查询模板】bzoj3132
    【树状数组区间加+区间查询模板】洛谷P3372
    51Nod
    CodeForces 631E Product Sum
    CodeForces
    [不知道哪来的题] 完美理论
    CodeForces
  • 原文地址:https://www.cnblogs.com/hamili/p/12168283.html
Copyright © 2011-2022 走看看