Commit f54756ea713b6001427548c344dd0d712ccdb8b1
1 parent
311886d2
Exists in
master
and in
2 other branches
feat: 新增SchemaPage自定义Footer插槽
Showing
1 changed file
with
16 additions
and
3 deletions
Show diff stats
packages/schema-page/index.vue
| @@ -59,8 +59,8 @@ | @@ -59,8 +59,8 @@ | ||
| 59 | </slot> | 59 | </slot> |
| 60 | </div> | 60 | </div> |
| 61 | <!-- 底部区域 --> | 61 | <!-- 底部区域 --> |
| 62 | - <div v-if="schema.selection !== false || schema.pagination !== false" class="z-schema-page__footer"> | ||
| 63 | - <slot name="pagination" v-bind="_slotScope"> | 62 | + <div v-if="schema.selection !== false || schema.pagination !== false || $scopedSlots.footer" class="z-schema-page__footer"> |
| 63 | + <slot name="footer" v-bind="_slotScope"> | ||
| 64 | <div v-if="schema.selection !== false && selection.length > 0" class="selection-info"> | 64 | <div v-if="schema.selection !== false && selection.length > 0" class="selection-info"> |
| 65 | <span>已选中</span> | 65 | <span>已选中</span> |
| 66 | <span class="num">{{ selection.length }}</span> | 66 | <span class="num">{{ selection.length }}</span> |
| @@ -260,7 +260,20 @@ export default { | @@ -260,7 +260,20 @@ export default { | ||
| 260 | }, | 260 | }, |
| 261 | _slotScope() { | 261 | _slotScope() { |
| 262 | const properties = ['selection', 'currentPage', 'pageSizes', 'pageSize', 'layout', 'total']; | 262 | const properties = ['selection', 'currentPage', 'pageSizes', 'pageSize', 'layout', 'total']; |
| 263 | - const methods = ['search', 'onSearch', 'onDelete', 'onDeleteMultiple', 'onTableSelectionChange', 'openNew', 'openEdit', 'openDetail', 'openDialog', 'closeDialog']; | 263 | + const methods = [ |
| 264 | + 'search', | ||
| 265 | + 'onSearch', | ||
| 266 | + 'onDelete', | ||
| 267 | + 'onDeleteMultiple', | ||
| 268 | + 'onSizeChange', | ||
| 269 | + 'onCurrentChange', | ||
| 270 | + 'onTableSelectionChange', | ||
| 271 | + 'openNew', | ||
| 272 | + 'openEdit', | ||
| 273 | + 'openDetail', | ||
| 274 | + 'openDialog', | ||
| 275 | + 'closeDialog', | ||
| 276 | + ]; | ||
| 264 | const defaultScope = { | 277 | const defaultScope = { |
| 265 | size: this._size, | 278 | size: this._size, |
| 266 | loading: this.tableLoading, | 279 | loading: this.tableLoading, |