Skip to content

Commit 5a418ef

Browse files
committed
EkCardGrid: Use simple grid if no pagination
If there is no need to paginate, just use a responsive grid.
1 parent fe3b218 commit 5a418ef

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

packages/ek-components/src/components/EkCardGrid.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<template>
22
<b-container
33
class="mb-5 mt-3 section-container"
4-
:fluid="variant === 'slidable-new'"
5-
:class="{ 'no-container-padding': variant === 'slidable' || variant === 'slidable-new' }"
4+
:fluid="displayVariant === 'EkSlidableCardGridNew'"
5+
:class="{ 'no-container-padding': (
6+
displayVariant === 'EkSlidableCardGrid' ||
7+
displayVariant === 'EkSlidableCardGridNew'
8+
) }"
69
>
710
<slot></slot>
811

@@ -65,6 +68,10 @@ export default {
6568
},
6669
computed: {
6770
displayVariant() {
71+
if (this.itemsPerPage >= this.nodes.length || this.itemsPerSlide.lg >= this.nodes.length) {
72+
// There is no need to display a more complex component if there is no pagination:
73+
return 'EkGridPage';
74+
}
6875
switch (this.variant) {
6976
case 'collapsible':
7077
return 'EkCollapsibleCardGrid';

0 commit comments

Comments
 (0)