문서 탐색

UIAnchor

링크를 구성하고 현재 위치나 비활성 상태를 표현합니다.

기본 사용법

디자인 토큰 페이지로 이동

href에 경로와 섹션 ID를 함께 전달하면 지정한 문서의 섹션으로 이동합니다.

<script setup lang="ts">
import { UIAnchor } from "@connextable/ui";
</script>

<template>
  <UIAnchor href="/design-system#design-colors">색상 토큰 보기</UIAnchor>
</template>

설정과 동작

링크에 아이콘 표시

icon에 Vue 컴포넌트를 전달해 링크 텍스트 앞에 표시합니다.

현재 위치 표시

선택된 링크의 현재 위치를 접근성 트리에 알립니다.

이동할 수 없는 링크

비활성 링크를 클릭해도 페이지는 바뀌지 않습니다.

실전 예제

Nuxt 라우트 객체로 이동

Nuxt 모듈을 등록한 앱에서는 UIAnchor의 to에 경로와 섹션을 담은 라우트 객체를 전달할 수 있습니다.

주요 API

속성과 모델

icon타입Component

링크 텍스트 앞에 표시할 Vue 아이콘 컴포넌트입니다.

링크에 아이콘 표시 예제
current타입AnchorCurrent | undefined

현재 위치를 접근성 트리에 전달합니다.

현재 위치 표시 예제

입력 상태

disabled타입boolean | undefined

링크의 활성화를 막습니다.

이동할 수 없는 링크 예제
href타입string | undefined

링크의 목적지입니다.

현재 위치 표시 예제
to타입string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined

Nuxt 경로 문자열 또는 라우트 객체입니다. href보다 우선합니다.

링크에 아이콘 표시 예제
external타입boolean | undefined

Nuxt에서 정적 파일이나 별도 앱으로 이동할 때 지정합니다.

전체 속성, 이벤트와 슬롯

UIAnchor

href
string | undefined
target
string | undefined
rel
string | undefined
download
string | boolean | undefined
disabled
boolean | undefined
current
AnchorCurrent | undefined
tab-index
string | number | undefined
as-child
boolean | undefined
prefetch
boolean | undefined
prefetch-on
PrefetchTrigger | Partial<Record<PrefetchTrigger, boolean>> | undefined
no-prefetch
boolean | undefined
to
string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined
external
boolean | undefined
replace
boolean | undefined
icon
Component | undefined
#default
(state: AnchorSlotState) => VNodeChild
#leading
(state: AnchorSlotState) => VNodeChild
#trailing
(state: AnchorSlotState) => VNodeChild
#content
(state: AnchorContentSlotState) => VNodeChild