Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持传入pageSize和currentPage来设定初始分页模式 #60

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

pzgz
Copy link
Contributor

@pzgz pzgz commented Mar 29, 2020

做了一个功能,因为项目中经常需要初始化时制定每页的大小和当前页,所以就暴露了currentPagepageSize,和内部的el-pagination组件类似,也支持sync修饰符,看有需要的话可以merge

Copy link
Owner

@zollero zollero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我加了一些comment,修改一下重新提交一下PR吧👍


currentPage: function(val) {
if (val) {
this.pagination.pageIndex = val
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对对象重新赋值的话,要先取原值,修改属性之后,再把修改后的对象重新赋值。

这里的代码修改一下吧,参考如下:

Suggested change
this.pagination.pageIndex = val
const { pagination} = this;
pagination.pageIndex = Val;
this.pagination = pagination;

PageSize属性的修改也同上。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants