Pagination: disabled prev and next buttons should not trigger click (#10628)

pull/10630/head
杨奕 2018-04-09 18:53:50 +08:00 committed by GitHub
parent 79325390e2
commit 0ae91ec37f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -113,7 +113,8 @@ export default {
return (
<button
type="button"
class={['btn-prev', { disabled: this.$parent.disabled || this.$parent.internalCurrentPage <= 1 }]}
class="btn-prev"
disabled={ this.$parent.disabled || this.$parent.internalCurrentPage <= 1 }
on-click={ this.$parent.prev }>
{
this.$parent.prevText
@ -130,10 +131,8 @@ export default {
return (
<button
type="button"
class={[
'btn-next',
{ disabled: this.$parent.disabled || this.$parent.internalCurrentPage === this.$parent.internalPageCount || this.$parent.internalPageCount === 0 }
]}
class="btn-next"
disabled={ this.$parent.disabled || this.$parent.internalCurrentPage === this.$parent.internalPageCount || this.$parent.internalPageCount === 0 }
on-click={ this.$parent.next }>
{
this.$parent.nextText

View File

@ -57,7 +57,7 @@
color: $--pagination-hover-fill;
}
&.disabled {
&:disabled {
color: $--pagination-button-disabled-color;
background-color: $--pagination-button-disabled-fill;
cursor: not-allowed;
@ -188,7 +188,7 @@
.btn-prev, .btn-next {
padding: 0;
&.disabled {
&:disabled {
color: $--color-text-placeholder;
}
}