| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <template>
- <div class="product--card--wrapper">
- <div class="product--card" :data-layout="layout" :data-image-position="imagePosition">
- <div class="product--card--thumb">
- <div class="product--card--thumb--inner">
- <!-- <img :src="image" :alt="imageAlt || title" loading="lazy" /> -->
- <img :src="image" :alt="title || title" loading="lazy" />
- </div>
- </div>
- <div class="product--card--content">
- <h2 v-if="title" class="product--card--title">{{ title }}</h2>
- <h3 v-if="subtitle" class="product--card--subtitle" v-html="subtitle"></h3>
- <div v-if="description" class="product--card--description">
- <p>{{ description }}</p>
- </div>
- <div v-if="buttonText && buttonUrl" class="product--card--actions">
- <NuxtLink :to="buttonUrl" :target="buttonTarget" class="default--round--btn">
- {{ buttonText }}
- </NuxtLink>
- </div>
- <div v-if="$slots.actions" class="product--card--actions">
- <slot name="actions"></slot>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- // Props 정의
- const props = defineProps({
- // 이미지 관련
- image: {
- type: String,
- required: true,
- },
- imageAlt: {
- type: String,
- default: "",
- },
- // 텍스트 관련
- title: {
- type: String,
- required: true,
- },
- subtitle: {
- type: String,
- default: "",
- },
- description: {
- type: String,
- default: "",
- },
- // 버튼 관련
- buttonText: {
- type: String,
- default: "",
- },
- buttonUrl: {
- type: String,
- default: "/",
- },
- buttonTarget: {
- type: String,
- default: "_self",
- validator: (value) => ["_self", "_blank"].includes(value),
- },
- // 레이아웃 옵션
- layout: {
- type: String,
- default: "horizontal", // 'horizontal', 'vertical'
- validator: (value) => ["horizontal", "vertical"].includes(value),
- },
- // 이미지 위치 옵션
- imagePosition: {
- type: String,
- default: "left", // 'left', 'right'
- validator: (value) => ["left", "right"].includes(value),
- },
- });
- </script>
|