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) {
              // 获取数据的接口
            }
          });
        }
      }
  • 相关阅读:
    使用RedisDesktopManager工具,解决连接失败问题
    安装redis,搭建环境
    CentOS 7下GitLab搭建及配置
    Metasploit之Hash攻击(Hashdump、Quarks PwDump、Windows Credentials Editor、Mimikatz)
    Metasploit之令牌窃取
    Metasploit之漏洞利用( Metasploitable2)
    Metasploit之主机扫描
    Metasploit模块简介
    WAF的那些事
    XXE漏洞介绍 & XXE漏洞攻击 & 修复建议
  • 原文地址:https://www.cnblogs.com/hamili/p/12168283.html
Copyright © 2011-2022 走看看