문서 표와 그리드

UIGrid

행과 열로 구성된 항목 사이를 이동합니다.

기본 사용법

그리드 셀 사이를 키보드로 이동

행별 셀 id를 rows에 전달합니다. 셀을 포커스한 뒤 방향키를 누르면 위치에 맞춰 다음 셀로 이동합니다.

요일별 예약 시간
월요일 09:00
월요일 10:30
월요일 13:00
월요일 14:30
화요일 09:00
화요일 10:30
화요일 13:00
화요일 14:30
수요일 09:00
수요일 10:30
수요일 13:00
수요일 14:30
<script setup lang="ts">
import { UIDataSurface, UIGrid, UIGridCell, UIGridRow } from "@connextable/ui";

const times = ["09:00", "10:30", "13:00", "14:30"];
const days = ["월요일", "화요일", "수요일"];
const rows = days.map((day) => times.map((time) => `${day} ${time}`));
</script>

<template>
  <UIDataSurface>
    <template #toolbar><strong>요일별 예약 시간</strong></template>
    <UIGrid :rows="rows" label="요일별 예약 시간" data-ui-tabular-striped>
      <UIGridRow v-for="row in rows" :key="row[0]">
        <UIGridCell
          v-for="cell in row"
          :key="cell"
          :value="cell"
          :aria-label="cell"
          data-ui-tabular-numeric
        >
          {{ cell }}
        </UIGridCell>
      </UIGridRow>
    </UIGrid>
  </UIDataSurface>
</template>

설정과 동작

특정 셀 건너뛰기

방향키로 상태 열을 지나갈 때 준비됨 셀은 비활성입니다.

선택한 셀 알리기

이동한 후 선택하면 외부 출력에 셀 값이 표시됩니다.

셀의 제목과 상태 편집

셀에 포커스한 뒤 F2 또는 Enter를 눌러 값을 수정합니다. Enter로 저장하고 Escape로 취소합니다.

실전 예제

예약된 시간을 건너뛰기

키보드로 셀을 이동하거나 가능한 시간을 클릭합니다. 이미 예약된 시간은 탐색과 선택에서 제외됩니다.

구성 컴포넌트

구조와 배치

UIGridRow

그리드에서 같은 행에 놓이는 셀을 묶습니다.

특정 셀 건너뛰기 예제

값 입력과 선택

UIGridCell

그리드에서 선택하거나 탐색할 항목입니다.

특정 셀 건너뛰기 예제
UIGridEditor

편집 모드에서 입력에 포커스하고, 입력 중인 값을 v-model로 연결합니다.

셀의 제목과 상태 편집 예제

주요 API

UIGrid속성과 모델

rows타입readonly (readonly (string | null)[])[]

행별로 셀 식별자를 묶은 배열입니다.

특정 셀 건너뛰기 예제
Cell value

화면의 셀을 rows에 등록한 식별자와 연결합니다.

UIGrid이벤트와 명령

edit-start / edit-commit / edit-cancel

편집 시작, 저장, 취소 시 해당 셀의 식별자를 전달합니다.

UIGridEditor속성과 모델

placeholder타입string

셀 편집 중 값이 비었을 때 해당 열의 입력 예를 표시합니다.

셀의 제목과 상태 편집 예제

UIGridEditor입력 상태

readonly타입boolean

현재 셀의 입력값을 읽거나 복사할 수 있습니다. 사용자가 텍스트를 수정할 수 없습니다.

disabled타입boolean

셀 편집기의 입력과 포커스를 비활성화합니다.

전체 속성, 이벤트와 슬롯

UIGrid

model-value
string | null | undefined
default-value
string | null | undefined
highlighted-value
string | null | undefined
default-highlighted-value
string | null | undefined
edit-mode
GridEditMode | undefined
default-edit-mode
GridEditMode | undefined
disabled-items
readonly string[] | undefined
disabled
boolean | undefined
readonly
boolean | undefined
label
string | undefined
policies
GridPolicies<string> | undefined
as
PrimitiveAs | undefined
as-child
boolean | undefined
@update:model-value
(_value: string | null) => any
rows필수
readonly (readonly (string | null)[])[]
@edit-cancel
(_value: string) => any
@edit-commit
(_value: string) => any
@edit-start
(_value: string) => any
@update:edit-mode
(_value: GridEditMode) => any
@update:highlighted-value
(_value: string | null) => any
#default
(props: GridRootSlotProps) => VNodeChild

UIGridRow

as
PrimitiveAs | undefined
as-child
boolean | undefined
#default
(props: GridRootSlotProps) => VNodeChild

UIGridCell

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

UIGridEditor

name
string | undefined
form
string | undefined
required
boolean | undefined
readonly
boolean | undefined
disabled
boolean | undefined
placeholder
string | undefined
model-value필수
string
@update:model-value
(value: string) => any