문서 선택

UICheckboxTree

계층 구조에서 여러 항목을 선택합니다.

기본 사용법

하위 항목을 묶어 선택

알림 채널을 선택하면 하위 항목이 함께 선택됩니다. 아래 항목 하나만 해제해 상위 항목의 혼합 상태를 확인할 수 있습니다.

알림 채널
이메일
모바일
<script setup lang="ts">
import { UICheckboxTree } from "@connextable/ui";
import { ref } from "vue";

const nodes = [
  { id: "notifications", parentID: null, label: "알림 채널" },
  { id: "email", parentID: "notifications", label: "이메일" },
  { id: "mobile", parentID: "notifications", label: "모바일" },
];

const channels = ref<readonly string[]>(["email"]);
</script>

<template>
  <UICheckboxTree
    v-model="channels"
    :nodes="nodes"
    :default-expanded-values="['notifications']"
    label="알림 채널"
    clearable
  />
</template>

설정과 동작

체크박스 트리의 항목 아이콘

노드의 icon을 지정하면 체크 표시와 이름 사이에 표시됩니다.

혼합 상태 부모

이메일만 선택되면 상위 항목이 혼합 상태입니다.

하위 가지 전체 제한

부모를 비활성화하면 subtree 정책으로 그 아래 노드도 함께 제한합니다.

선택이 잠긴 하위 항목

상위 항목을 선택해도 잠긴 모바일 값은 바뀌지 않습니다.

구성 컴포넌트

구조와 배치

UICheckboxTreeGroup

상위 항목에 속한 하위 항목을 묶습니다.

혼합 상태 부모 예제

값 입력과 선택

UICheckboxTreeItem

루트에 등록된 값 하나를 표시하고 상호작용을 연결합니다.

혼합 상태 부모 예제

탐색과 동작

UICheckboxTreeDisclosure

하위 항목을 펼치거나 접습니다.

혼합 상태 부모 예제

값과 상태 표시

UICheckboxTreeIndicator

트리 행의 미선택, 선택 및 혼합 체크 상태를 표시합니다.

혼합 상태 부모 예제

주요 API

속성과 모델

v-model타입readonly string[] | undefined

선택된 항목의 id 배열을 연결합니다.

체크박스 트리의 항목 아이콘 예제
nodes[].icon타입Component

체크 표시와 항목 이름 사이에 표시할 아이콘입니다.

체크박스 트리의 항목 아이콘 예제
nodes타입readonly TreeNodeInput<string>[] & readonly LabeledTreeNode[]

id, parentID, 선택 사항인 label과 icon으로 트리 항목을 구성합니다. icon은 체크 표시와 항목 이름 사이에 나타납니다.

체크박스 트리의 항목 아이콘 예제
clearable타입boolean | undefined

선택을 지울 수 있는 버튼을 표시합니다.

하위 항목을 묶어 선택 예제
default-expanded-values타입readonly string[] | undefined

처음 펼쳐 놓을 상위 항목의 id입니다.

체크박스 트리의 항목 아이콘 예제

입력 상태

readonly타입boolean

값을 유지하고 사용자 조작으로 변경되는 것을 막습니다. 읽기와 탐색은 계속 지원합니다.

disabled타입boolean

입력과 선택을 비활성화합니다. 네이티브 입력은 Tab 순서에서 빠집니다.

슬롯

Item #default

선택, 미선택 또는 혼합을 checked로 받습니다.

전체 속성, 이벤트와 슬롯

UICheckboxTree

nodes필수
readonly TreeNodeInput<string>[] & readonly LabeledTreeNode[]
model-value
readonly string[] | undefined
default-value
readonly string[] | undefined
expanded-values
readonly string[] | undefined
default-expanded-values
readonly string[] | undefined
highlighted-value
string | null | undefined
default-highlighted-value
string | null | undefined
disabled-items
readonly string[] | undefined
disabled-propagation
"self" | "subtree" | undefined
disabled
boolean | undefined
readonly
boolean | undefined
label
string | undefined
as
PrimitiveAs | undefined
as-child
boolean | undefined
@update:model-value
(value: readonly string[]) => any
@update:expanded-values
(value: readonly string[]) => any
@update:highlighted-value
(value: string | null) => any
name
string | undefined
form
string | undefined
required
boolean | undefined
clearable
boolean | undefined
clear-label
string | undefined
#default
(state: CheckboxTreeRootSlotProps<string>) => VNodeChild

UICheckboxTreeGroup

as-child
boolean | undefined
force-present
boolean | undefined
as
PrimitiveAs | undefined
for필수
string
#default
(state: TreeViewRootSlotProps) => VNodeChild

UICheckboxTreeItem

value필수
string
disabled
undefined
as
PrimitiveAs | undefined
as-child
boolean | undefined
#default
(state: CheckboxTreeItemSlotProps) => VNodeChild

UICheckboxTreeDisclosure

for필수
string
as
PrimitiveAs | undefined
as-child
boolean | undefined
#default
(state: CheckboxTreeItemSlotProps) => VNodeChild

UICheckboxTreeIndicator

#control
(props: {}) => any
#default
(props: {}) => any