Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 如何在react中使用分页,以便对api中的数据进行相应的分页 **因为以下代码仅给出分页条** `this.handleClick(e)} />`_Reactjs - Fatal编程技术网

Reactjs 如何在react中使用分页,以便对api中的数据进行相应的分页 **因为以下代码仅给出分页条** `this.handleClick(e)} />`

Reactjs 如何在react中使用分页,以便对api中的数据进行相应的分页 **因为以下代码仅给出分页条** `this.handleClick(e)} />`,reactjs,Reactjs,但是我想绑定来自API的数据我为商业项目构建了它,它看起来非常庞大。它与取回结合在一起。它使用引导类并且看起来很好(imho) 更新如我所见,我的答案与您的问题不符,因为您询问的是某个库。但尽管如此,我还是搜索了这样的库,但决定自己写一个简单的组件我为商业项目构建了它,它看起来很庞大。它与取回结合在一起。它使用引导类并且看起来很好(imho) const UrlHandler = (function () { let handler = { state: {}, s

但是我想绑定来自API的数据

我为商业项目构建了它,它看起来非常庞大。它与取回结合在一起。它使用引导类并且看起来很好(imho)


更新如我所见,我的答案与您的问题不符,因为您询问的是某个库。但尽管如此,我还是搜索了这样的库,但决定自己写一个简单的组件

我为商业项目构建了它,它看起来很庞大。它与取回结合在一起。它使用引导类并且看起来很好(imho)
const UrlHandler = (function () {


  let handler = {

    state: {},

    setParamsFromBar: function () {
      UrlHandler.state = new URLSearchParams(location.search);
      $(window).trigger(EVENT_ON_HISTORY_CHANGE);
    },

    getParam: function (param) {
      return this.state.get(param);
    },

    getAllParams: function () {
      return this.state.toString();
    },

    setParams: function (newParams, updateHistory) {
      for ( let [param, value] of Object.entries(newParams)){
        this.state.set(param, value);
      }

      updateHistory && this.updateHistory();
    },

    updateHistory:function () {
      const params = {};

      for(let [param, value] of this.state.entries()){
        params[param] = value;
      }

      history.pushState(
        params,
        'page titile',
        '?' + this.getAllParams()
      )
    }

  };

  $(window).on('popstate', handler.setParamsFromBar);
  handler.state = new URLSearchParams(location.search);

  return handler
})();

更新如我所见,我的答案与您的问题不符,因为您询问的是某个库。但尽管如此,我还是搜索了这样的库,但决定自己编写一个简单的组件


const UrlHandler = (function () {


  let handler = {

    state: {},

    setParamsFromBar: function () {
      UrlHandler.state = new URLSearchParams(location.search);
      $(window).trigger(EVENT_ON_HISTORY_CHANGE);
    },

    getParam: function (param) {
      return this.state.get(param);
    },

    getAllParams: function () {
      return this.state.toString();
    },

    setParams: function (newParams, updateHistory) {
      for ( let [param, value] of Object.entries(newParams)){
        this.state.set(param, value);
      }

      updateHistory && this.updateHistory();
    },

    updateHistory:function () {
      const params = {};

      for(let [param, value] of this.state.entries()){
        params[param] = value;
      }

      history.pushState(
        params,
        'page titile',
        '?' + this.getAllParams()
      )
    }

  };

  $(window).on('popstate', handler.setParamsFromBar);
  handler.state = new URLSearchParams(location.search);

  return handler
})();
身份证件 标题 作者 类别
这帮助我解决了问题

身份证件
标题
作者
类别

这帮助我解决了问题,别忘了安装@npm install react bootstrap table——保存并添加导入“node_modules/react bootstrap table/dist/react bootstrap table all.min.css”;(或)从“react bootstrap表”导入“../node\u modules/react bootstrap table/dist/react bootstrap table”“import{BootstrapTable,TableHeaderColumn,BootstrapButton}”;别忘了安装@npm install react bootstrap table——保存并添加导入“node_modules/react bootstrap table/dist/react bootstrap table all.min.css”;(或)从“react bootstrap table”导入“../node_模块/react bootstrap table/dist/react bootstrap table”{BootstrapTable,TableHeaderColumn,BootstrapButton}”;谢谢你的回答,但我尝试了另一种方式,我已经在这里发布了我的部分,你可以通过它。谢谢你的回答,但我尝试了另一种方式,我已经在这里发布了我的部分,你可以通过它。
const UrlHandler = (function () {


  let handler = {

    state: {},

    setParamsFromBar: function () {
      UrlHandler.state = new URLSearchParams(location.search);
      $(window).trigger(EVENT_ON_HISTORY_CHANGE);
    },

    getParam: function (param) {
      return this.state.get(param);
    },

    getAllParams: function () {
      return this.state.toString();
    },

    setParams: function (newParams, updateHistory) {
      for ( let [param, value] of Object.entries(newParams)){
        this.state.set(param, value);
      }

      updateHistory && this.updateHistory();
    },

    updateHistory:function () {
      const params = {};

      for(let [param, value] of this.state.entries()){
        params[param] = value;
      }

      history.pushState(
        params,
        'page titile',
        '?' + this.getAllParams()
      )
    }

  };

  $(window).on('popstate', handler.setParamsFromBar);
  handler.state = new URLSearchParams(location.search);

  return handler
})();
  <BootstrapTable data={data} selector
        containerStyle={{ width: 'auto' }}      
        pagination
        search striped={true} hover={true}>
  <TableHeaderColumn isKey dataField='id'>id</TableHeaderColumn>
  <TableHeaderColumn dataField='title'>title</TableHeaderColumn>
  <TableHeaderColumn dataField='author'>author</TableHeaderColumn>
  <TableHeaderColumn dataField='category'>category</TableHeaderColumn>
  <TableHeaderColumn
    dataField='button'
    dataFormat={this.cellButton.bind(this)}
  />