mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-16 11:44:01 +08:00
Pagination: add hide-on-single-page attribute (#15096)
This commit is contained in:
@@ -52,7 +52,9 @@ export default {
|
||||
|
||||
background: Boolean,
|
||||
|
||||
disabled: Boolean
|
||||
disabled: Boolean,
|
||||
|
||||
hideOnSinglePage: Boolean
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -65,12 +67,14 @@ export default {
|
||||
},
|
||||
|
||||
render(h) {
|
||||
const layout = this.layout;
|
||||
if (!layout) return null;
|
||||
if (this.hideOnSinglePage && (!this.internalPageCount || this.internalPageCount === 1)) return null;
|
||||
|
||||
let template = <div class={['el-pagination', {
|
||||
'is-background': this.background,
|
||||
'el-pagination--small': this.small
|
||||
}] }></div>;
|
||||
const layout = this.layout || '';
|
||||
if (!layout) return;
|
||||
const TEMPLATE_MAP = {
|
||||
prev: <prev></prev>,
|
||||
jumper: <jumper></jumper>,
|
||||
|
||||
Reference in New Issue
Block a user