fix pagination

This commit is contained in:
tangjinzhou 2018-03-07 10:48:33 +08:00
parent fab5c432ca
commit 73597a19e5
4 changed files with 6 additions and 15 deletions

View File

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

View File

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

View File

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

View File

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