mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-16 11:44:01 +08:00
Pagination: add chalk theme (#7005)
* Pagination: add chalk theme * Pagination: fix test * Pagination: del useless test case * Pagination: fix shake of number
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import Pager from './pager.vue';
|
||||
import ElSelect from 'element-ui/packages/select';
|
||||
import ElOption from 'element-ui/packages/option';
|
||||
import ElInput from 'element-ui/packages/input';
|
||||
import Locale from 'element-ui/src/mixins/locale';
|
||||
|
||||
export default {
|
||||
@@ -34,7 +35,11 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
popperClass: String
|
||||
popperClass: String,
|
||||
|
||||
prevText: String,
|
||||
|
||||
nextText: String
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -102,7 +107,11 @@ export default {
|
||||
type="button"
|
||||
class={['btn-prev', { disabled: this.$parent.internalCurrentPage <= 1 }]}
|
||||
on-click={ this.$parent.prev }>
|
||||
<i class="el-icon el-icon-arrow-left"></i>
|
||||
{
|
||||
this.$parent.prevText
|
||||
? <span>{ this.$parent.prevText }</span>
|
||||
: <i class="el-icon el-icon-arrow-left"></i>
|
||||
}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@@ -118,7 +127,11 @@ export default {
|
||||
{ disabled: this.$parent.internalCurrentPage === this.$parent.internalPageCount || this.$parent.internalPageCount === 0 }
|
||||
]}
|
||||
on-click={ this.$parent.next }>
|
||||
<i class="el-icon el-icon-arrow-right"></i>
|
||||
{
|
||||
this.$parent.nextText
|
||||
? <span>{ this.$parent.nextText }</span>
|
||||
: <i class="el-icon el-icon-arrow-right"></i>
|
||||
}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@@ -166,7 +179,8 @@ export default {
|
||||
|
||||
components: {
|
||||
ElSelect,
|
||||
ElOption
|
||||
ElOption,
|
||||
ElInput
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -203,8 +217,8 @@ export default {
|
||||
this.handleChange({ target: event.target });
|
||||
}
|
||||
},
|
||||
handleChange({ target }) {
|
||||
this.$parent.internalCurrentPage = this.$parent.getValidCurrentPage(target.value);
|
||||
handleChange(value) {
|
||||
this.$parent.internalCurrentPage = this.$parent.getValidCurrentPage(value);
|
||||
this.oldValue = null;
|
||||
},
|
||||
reassignMaxValue(target) {
|
||||
@@ -218,18 +232,17 @@ export default {
|
||||
return (
|
||||
<span class="el-pagination__jump">
|
||||
{ this.t('el.pagination.goto') }
|
||||
<input
|
||||
class="el-pagination__editor"
|
||||
type="number"
|
||||
<el-input
|
||||
class="el-pagination__editor is-in-pagination"
|
||||
min={ 1 }
|
||||
max={ this.$parent.internalPageCount }
|
||||
value={ this.$parent.internalCurrentPage }
|
||||
domProps-value={ this.$parent.internalCurrentPage }
|
||||
on-change={ this.handleChange }
|
||||
on-focus={ this.handleFocus }
|
||||
on-blur={ this.handleBlur }
|
||||
on-keyup={ this.handleKeyUp }
|
||||
number/>
|
||||
domPropsValue={ this.$parent.internalCurrentPage }
|
||||
type="number"
|
||||
onChange={ this.handleChange }
|
||||
onFocus={ this.handleFocus }
|
||||
onBlur={ this.handleBlur }
|
||||
nativeOnKeyup={ this.handleKeyUp }/>
|
||||
{ this.t('el.pagination.pageClassifier') }
|
||||
</span>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user