mirror of https://github.com/ElemeFE/element
Pagination: ensure currentPage is updated in current-change handler (#10599)
parent
7dbe646030
commit
dcf0488a3e
|
@ -390,12 +390,10 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newVal !== undefined) {
|
if (newVal !== undefined) {
|
||||||
this.$nextTick(() => {
|
this.internalCurrentPage = newVal;
|
||||||
this.internalCurrentPage = newVal;
|
if (oldVal !== newVal) {
|
||||||
if (oldVal !== newVal) {
|
this.$emit('update:currentPage', newVal);
|
||||||
this.$emit('update:currentPage', newVal);
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
this.$emit('update:currentPage', newVal);
|
this.$emit('update:currentPage', newVal);
|
||||||
}
|
}
|
||||||
|
|
|
@ -278,7 +278,7 @@ describe('DatePicker', () => {
|
||||||
input.focus();
|
input.focus();
|
||||||
setTimeout(_ => {
|
setTimeout(_ => {
|
||||||
const picker = vm.$refs.compo.picker;
|
const picker = vm.$refs.compo.picker;
|
||||||
picker.$el.querySelector('td.available + td.today').click();
|
picker.$el.querySelector('td.available').click();
|
||||||
setTimeout(_ => {
|
setTimeout(_ => {
|
||||||
const date = vm.$refs.compo.picker.date;
|
const date = vm.$refs.compo.picker.date;
|
||||||
expect(date.getHours()).to.equal(12);
|
expect(date.getHours()).to.equal(12);
|
||||||
|
|
Loading…
Reference in New Issue