Element: [Bug Report] Two paginators for one data (top and bottom pagination for one table)

Created on 31 Jul 2017  ·  12Comments  ·  Source: ElemeFE/element

Element UI version

1.4.1

OS/Browsers version

Ubuntu 16.04 / Chrome 60

Vue version

2.4.2

Reproduction Link

https://jsfiddle.net/6kpt8qna/2/

Steps to reproduce

  1. Click to some page number.

What is Expected?

One alert

What is actually happening?

Two alerts

All 12 comments

current-page has changed for both Pagination instances, so they both emits a current-change event. I don't see anything wrong here.

maybe he want to say, when you click 7 number , you will got 4 times alerts

@Leopoldthecoder event must be triggered only with internal changes (click on page number).

@mario56, I want to create two paginators with same reference to page number and same event-listener.
Paginator has internal counter, but event current-change is triggered by all changes (internal or external): if current-page changed from other code (e.g. other paginator), current-change event will triggered.

@zlodes

this.page = 4;

current-page set by your code. This situation you don't want current-change event will triggered??

many components has this problem.

@Leopoldthecoder May be a change event for pagination? Similar to form inputs. 🤣

See https://github.com/ElemeFE/element/issues/6011

I was faced with the same problem. A long table with two paginator at the top and bottom. Click on the button invokes the 'current-change' event for the paginator number, associated with a page table

If you want to solve this problem right away, watch the page property (or whatever passed to pagination).

Fair enough, we'll see what we can do.

For now a workaround may be https://jsfiddle.net/6kpt8qna/3/

I'm currently working on this issue and there's something I need advice on.

https://jsfiddle.net/j63ctvh4/
In this demo, when a user selects 200 items/page in the page size Select, the current page will be updated to 5.

If current-change event only triggers on user input, should it be fired in the above scenario?
Technically this user didn't click any page button, but his action ultimately led to current page change.

If your answer is yes, should the current-change event be fired when you programmatically change the page size?

Personally my answers to these two questions are: 1. yes and 2. no. I'd like to hear your opinions.

@Leopoldthecoder I agree with you.

6595

Was this page helpful?
0 / 5 - 0 ratings

Related issues

makunsusu picture makunsusu  ·  3Comments

FranzSkuffka picture FranzSkuffka  ·  3Comments

yubo111 picture yubo111  ·  3Comments

chao-hua picture chao-hua  ·  3Comments

no5no6 picture no5no6  ·  3Comments