| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <template>
- <div class="inner--link--contents">
- <ul>
- <li v-for="(item, index) in links" :key="index">
- <NuxtLink :to="item.url" :target="item.target || '_self'" :class="item.class">
- {{ item.text }}
- <svg
- v-if="item.showIcon !== false"
- width="24"
- height="24"
- aria-label="New Tab"
- xmlns="http://www.w3.org/2000/svg"
- stroke="#fff"
- data-testid="link-icon"
- >
- <title>New Tab</title>
- <path
- d="M17.5 11.594V20.5h-15v-15h7.969m4.031-3h6v6m-9 3 9-9-9 9Z"
- stroke="#fff"
- fill="none"
- ></path>
- </svg>
- </NuxtLink>
- </li>
- </ul>
- </div>
- </template>
- <script setup>
- // Props 정의
- const props = defineProps({
- links: {
- type: Array,
- required: true,
- default: () => [],
- validator: (value) => {
- // 각 링크 객체가 필수 속성을 가지고 있는지 확인
- return value.every(
- (link) => link.hasOwnProperty("text") && link.hasOwnProperty("url")
- );
- },
- },
- });
- // 링크 데이터 구조 예시:
- // [
- // {
- // text: "Q8 50 TDI quattro exclusive edition 예약금 결제",
- // url: "/reservation/q8",
- // target: "_blank", // 선택사항, 기본값: "_self"
- // showIcon: true, // 선택사항, 기본값: true
- // class: "custom-class" // 선택사항
- // },
- // {
- // text: "RS 6 Avant 예약금 결제",
- // url: "/reservation/rs6",
- // target: "_self",
- // showIcon: false
- // }
- // ]
- </script>
|