Skip to content
Discussion options

You must be logged in to vote

Edit: I had custom.css issue

vue

<script setup lang="ts">
import { ref, computed } from 'vue'
import { withBase } from 'vitepress'

const props = defineProps<{
  images: string[] | string
  captions?: string[] | string  // přidáno
}>()

// přijme buď pole, nebo "comma-separated" string a doplní base (GitHub Pages apod.)
const list = computed(() => {
  const raw = Array.isArray(props.images)
    ? props.images
    : typeof props.images === 'string'
      ? props.images.split(',').map(s => s.trim()).filter(Boolean)
      : []
  return raw.map(src => withBase(src))
})

// nový: zpracování popisků
const captionList = computed(() => {
  if (!props.captions) return list.value.map(() => '') 
  c…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MikeCZ23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant