salt-ui / saltui

MIT License
238 stars 64 forks source link

Pagination 分页报错 #321

Open Zyyao11 opened 5 years ago

Zyyao11 commented 5 years ago

请按照以下模板填写,不按照标准模板填写的 issue 将降低处理优先级。

这是一个

SaltUI 版本

4.2.2

浏览器、操作系统等环境信息

chrome 70.0.3538.110(正式版本) (64 位) macOS 10.13.6

复现步骤

Warning: Invalid argument supplied to oneOf, expected an instance of array.

eternalsky commented 5 years ago

请提供复现 demo。

Zyyao11 commented 5 years ago

import { Component } from 'refast';

import Storage from '../../app/storage'; import { Pagination } from 'saltui'; import config from "../../app/variables";

export default class PagePayroll extends Component {

constructor(props) {
    super(props);

    this.state = {
        current: 9,
      };

} componentDidMount() {

} handleGotoDetail(){ console.log('1>>点击修改当前页面为4,current:'+this.state.current) let t = this; t.state.current=4; t.setState({ current:4 }) console.log('2>>>>>>>点击修改当前页面为4,current:'+this.state.current)

}

render() { const t = this;

return (
  <div className="page-result-searchBox page-result-search">

  <div  onClick={this.handleGotoDetail.bind(this)}><h5>点击修改当前页面为4</h5></div>
  <br></br>

  此时:{this.state.current}

  <Pagination
      current={this.state.current} total={101} pageSize={10}
      onChange={(current) => {
        console.log(current);
        this.setState({ current });
      }}
    />

  </div>
);

} }

eternalsky commented 5 years ago

请通过 https://codepen.io/eternalsky/pen/WpzYrv 提供一个可以 debug 的版本。

Zyyao11 commented 5 years ago

https://codepen.io/zyyao11/details/gZOZzy 无法复现,想请问具体的SaltUI版本,本地运行的是4.2.2版本,期间测试过程中,3.1.7版本是可以使用

Zyyao11 commented 5 years ago

https://codepen.io/zyyao11/details/gZOZzy ,已复现