Commit 23a2e8d9 authored by mengro's avatar mengro Committed by 杨奕

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
parent 48c7bcc9
...@@ -253,15 +253,16 @@ export default { ...@@ -253,15 +253,16 @@ export default {
const num = parseInt(value, 10); const num = parseInt(value, 10);
if (!isNaN(num)) { if (!isNaN(num)) {
if (num < 1) { if (num < 1) {
this.$refs.input.$el.querySelector('input').value = 1; this.$refs.input.setCurrentValue(1);
} else { } else {
this.reassignMaxValue(value); this.reassignMaxValue(value);
} }
} }
}, },
reassignMaxValue(value) { reassignMaxValue(value) {
if (+value > this.$parent.internalPageCount) { var internalPageCount = this.$parent.internalPageCount;
this.$refs.input.$el.querySelector('input').value = this.$parent.internalPageCount; if (+value > internalPageCount) {
this.$refs.input.setCurrentValue(internalPageCount);
} }
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment