Pagination: ensure currentPage is updated in current-change handler (#10599)

pull/10584/merge
杨奕 2018-04-08 13:58:47 +08:00 committed by GitHub
parent 7dbe646030
commit dcf0488a3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View File

@ -390,12 +390,10 @@ export default {
}
if (newVal !== undefined) {
this.$nextTick(() => {
this.internalCurrentPage = newVal;
if (oldVal !== newVal) {
this.$emit('update:currentPage', newVal);
}
});
} else {
this.$emit('update:currentPage', newVal);
}

View File

@ -278,7 +278,7 @@ describe('DatePicker', () => {
input.focus();
setTimeout(_ => {
const picker = vm.$refs.compo.picker;
picker.$el.querySelector('td.available + td.today').click();
picker.$el.querySelector('td.available').click();
setTimeout(_ => {
const date = vm.$refs.compo.picker.date;
expect(date.getHours()).to.equal(12);