|
@@ -42,7 +42,9 @@ export default {
|
|
|
|
|
|
nextText: String,
|
|
|
|
|
|
- background: Boolean
|
|
|
+ background: Boolean,
|
|
|
+
|
|
|
+ disabled: Boolean
|
|
|
},
|
|
|
|
|
|
data() {
|
|
@@ -62,7 +64,7 @@ export default {
|
|
|
const TEMPLATE_MAP = {
|
|
|
prev: <prev></prev>,
|
|
|
jumper: <jumper></jumper>,
|
|
|
- pager: <pager currentPage={ this.internalCurrentPage } pageCount={ this.internalPageCount } on-change={ this.handleCurrentChange }></pager>,
|
|
|
+ pager: <pager currentPage={ this.internalCurrentPage } pageCount={ this.internalPageCount } on-change={ this.handleCurrentChange } disabled={ this.disabled }></pager>,
|
|
|
next: <next></next>,
|
|
|
sizes: <sizes pageSizes={ this.pageSizes }></sizes>,
|
|
|
slot: <my-slot></my-slot>,
|
|
@@ -107,7 +109,7 @@ export default {
|
|
|
return (
|
|
|
<button
|
|
|
type="button"
|
|
|
- class={['btn-prev', { disabled: this.$parent.internalCurrentPage <= 1 }]}
|
|
|
+ class={['btn-prev', { disabled: this.$parent.disabled || this.$parent.internalCurrentPage <= 1 }]}
|
|
|
on-click={ this.$parent.prev }>
|
|
|
{
|
|
|
this.$parent.prevText
|
|
@@ -126,7 +128,7 @@ export default {
|
|
|
type="button"
|
|
|
class={[
|
|
|
'btn-next',
|
|
|
- { disabled: this.$parent.internalCurrentPage === this.$parent.internalPageCount || this.$parent.internalPageCount === 0 }
|
|
|
+ { disabled: this.$parent.disabled || this.$parent.internalCurrentPage === this.$parent.internalPageCount || this.$parent.internalPageCount === 0 }
|
|
|
]}
|
|
|
on-click={ this.$parent.next }>
|
|
|
{
|
|
@@ -166,7 +168,8 @@ export default {
|
|
|
<el-select
|
|
|
value={ this.$parent.internalPageSize }
|
|
|
popperClass={ this.$parent.popperClass || '' }
|
|
|
- on-input={ this.handleChange }>
|
|
|
+ on-input={ this.handleChange }
|
|
|
+ disabled={ this.$parent.disabled }>
|
|
|
{
|
|
|
this.pageSizes.map(item =>
|
|
|
<el-option
|
|
@@ -253,6 +256,7 @@ export default {
|
|
|
domPropsValue={ this.$parent.internalCurrentPage }
|
|
|
type="number"
|
|
|
ref="input"
|
|
|
+ disabled={ this.$parent.disabled }
|
|
|
nativeOnKeyup={ this.handleKeyup }
|
|
|
onChange={ this.handleChange }
|
|
|
onFocus={ this.handleFocus }
|
|
@@ -284,11 +288,13 @@ export default {
|
|
|
},
|
|
|
|
|
|
prev() {
|
|
|
+ if (this.disabled) return;
|
|
|
const newVal = this.internalCurrentPage - 1;
|
|
|
this.internalCurrentPage = this.getValidCurrentPage(newVal);
|
|
|
},
|
|
|
|
|
|
next() {
|
|
|
+ if (this.disabled) return;
|
|
|
const newVal = this.internalCurrentPage + 1;
|
|
|
this.internalCurrentPage = this.getValidCurrentPage(newVal);
|
|
|
},
|