mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-16 11:44:01 +08:00
Pagination: use setCurrentValue when reassigning input value (#11608)
* Pagination: input bug currentValue in input component's data object didn't refresh when changeHandle emited * Update pagination.js
This commit is contained in:
@@ -253,15 +253,16 @@ export default {
|
||||
const num = parseInt(value, 10);
|
||||
if (!isNaN(num)) {
|
||||
if (num < 1) {
|
||||
this.$refs.input.$el.querySelector('input').value = 1;
|
||||
this.$refs.input.setCurrentValue(1);
|
||||
} else {
|
||||
this.reassignMaxValue(value);
|
||||
}
|
||||
}
|
||||
},
|
||||
reassignMaxValue(value) {
|
||||
if (+value > this.$parent.internalPageCount) {
|
||||
this.$refs.input.$el.querySelector('input').value = this.$parent.internalPageCount;
|
||||
var internalPageCount = this.$parent.internalPageCount;
|
||||
if (+value > internalPageCount) {
|
||||
this.$refs.input.setCurrentValue(internalPageCount);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user