saltui icon indicating copy to clipboard operation
saltui copied to clipboard

Pagination 分页报错

Open Zyyao11 opened this issue 6 years ago • 5 comments

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

这是一个

  • [x] 错误报告
  • [ ] 功能需求

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.

  • 你可以在这里提交你的 CodePen 链接 以及描述复现的步骤

Zyyao11 avatar Dec 07 '18 03:12 Zyyao11

请提供复现 demo。

eternalsky avatar Dec 07 '18 03:12 eternalsky

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>
);

} }

Zyyao11 avatar Dec 07 '18 07:12 Zyyao11

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

eternalsky avatar Dec 10 '18 06:12 eternalsky

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

Zyyao11 avatar Dec 11 '18 01:12 Zyyao11

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

Zyyao11 avatar Dec 11 '18 03:12 Zyyao11