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
pull/11641/head
mengro 2018-06-15 11:44:09 +08:00 committed by 杨奕
parent 48c7bcc933
commit 23a2e8d9ee
1 changed files with 4 additions and 3 deletions

View File

@ -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);
} }
} }
}, },