mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-16 11:44:01 +08:00
Pagination: reset invalid jumper value (#8408)
* fix pagination jumper value * fix lint
This commit is contained in:
@@ -223,6 +223,17 @@ export default {
|
||||
handleChange(value) {
|
||||
this.$parent.internalCurrentPage = this.$parent.getValidCurrentPage(value);
|
||||
this.oldValue = null;
|
||||
this.resetValueIfNeed(target);
|
||||
},
|
||||
resetValueIfNeed(target) {
|
||||
const num = parseInt(target.value, 10);
|
||||
if (!isNaN(num)) {
|
||||
if (num < 1) {
|
||||
target.value = 1;
|
||||
} else {
|
||||
this.reassignMaxValue(target);
|
||||
}
|
||||
}
|
||||
},
|
||||
reassignMaxValue(target) {
|
||||
if (+target.value > this.$parent.internalPageCount) {
|
||||
|
||||
Reference in New Issue
Block a user