File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/nimiq-vitepress-theme/src/components Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11<script setup lang="ts">
2+ import { defineAsyncComponent } from ' vue'
23import type { NqCardProps } from ' ./NqCard.vue'
34
5+ const NqCard = defineAsyncComponent (() => import (' ./NqCard.vue' ))
6+ const NqLargeCard = defineAsyncComponent (() => import (' ./NqLargeCard.vue' ))
7+
48type CardSpan = ' full' | ' half' | ' default'
59type NqCardInGrid = NqCardProps & { span? : CardSpan }
610
7- const { cards } = defineProps <{ cards? : NqCardInGrid [] }>()
11+ const { cards, largeCards = false } = defineProps <{ cards? : NqCardInGrid [], largeCards ? : boolean }>()
812
913function getSpan({ span , bgColor }: NqCardInGrid ): CardSpan | undefined {
1014 if (span === undefined && bgColor )
@@ -17,7 +21,7 @@ function getSpan({ span, bgColor }: NqCardInGrid): CardSpan | undefined {
1721 <ul grid =" ~ cols-6 gap-16" class =" nq-grid nq-raw" >
1822 <slot >
1923 <li v-for =" (card, index) in cards" :key =" index" :data-span =" getSpan(card)" >
20- <NqCard v-bind =" card" />
24+ <component :is = " largeCards ? NqLargeCard : NqCard" v-bind =" card" />
2125 </li >
2226 </slot >
2327 </ul >
You can’t perform that action at this time.
0 commit comments