Browse Source

fix pagination

pull/165/head
tangjinzhou 7 years ago
parent
commit
9d77a0aef4
  1. 6
      components/pagination/Pagination.vue
  2. 2
      components/vc-pagination/Options.vue
  3. 5
      components/vc-pagination/Pager.vue
  4. 8
      components/vc-pagination/Pagination.vue

6
components/pagination/Pagination.vue

@ -40,12 +40,6 @@ export default {
model: {
prop: 'current',
},
data () {
const { current } = this
return {
stateCurrent: +current,
}
},
methods: {
renderPagination (locale) {
const { buildOptionText, size, ...restProps } = getOptionProps(this)

2
components/vc-pagination/Options.vue

@ -101,7 +101,7 @@ export default {
gotoButton = (
<span
onClick={this.go}
onKeyUp={this.go}
onKeyup={this.go}
>{goButton}</span>
)
}

5
components/vc-pagination/Pager.vue

@ -22,9 +22,6 @@ export default {
if (this.active) {
cls = `${cls} ${prefixCls}-active`
}
if (this.className) {
cls = `${cls} ${this.className}`
}
return cls
},
},
@ -33,7 +30,7 @@ export default {
this.$emit('click', this.page)
},
handleKeyPress (event) {
this.$emit('keyPress', event, this.handleClick, this.page)
this.$emit('keypress', event, this.handleClick, this.page)
},
},
render () {

8
components/vc-pagination/Pagination.vue

@ -84,7 +84,7 @@ export default {
let current = this.current
const newCurrent = this.calculatePage(val)
current = current > newCurrent ? newCurrent : current
if (hasProp(this, 'current')) {
if (!hasProp(this, 'current')) {
newState.stateCurrent = current
newState.stateCurrentInputValue = current
}
@ -188,7 +188,7 @@ export default {
stateCurrentInputValue: page,
})
}
this.$emit('input', page)
// this.$emit('input', page)
this.$emit('change', page, this.statePageSize)
return page
}
@ -254,7 +254,7 @@ export default {
<button
type='button'
onClick={this.handleGoTO}
onKeyUp={this.handleGoTO}
onKeyup={this.handleGoTO}
>
{locale.jump_to_confirm}
</button>
@ -263,7 +263,7 @@ export default {
gotoButton = (
<span
onClick={this.handleGoTO}
onKeyUp={this.handleGoTO}
onKeyup={this.handleGoTO}
>{goButton}</span>
)
}

Loading…
Cancel
Save