본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Drawer

원문 보기 위키 갱신

Drawer (드로어)

Modal과 비슷하지만, 위치(placement)가 조금 다르다고 생각하는 컴포넌트예요. 화면 가장자리에서 슬라이드로 열리는 패널이죠.

n-drawer-content를 사용해야 한다면 n-drawer의 native-scrollbar prop을 true로 유지해야 해요.

출처: 문서

본문

Demos

basic.vue
multiple.vue
closable.vue
target.vue
slot.vue
scroll.vue
resizable.vue

API

Drawer Props

이름 파라미터 기본값 설명 버전
auto-focus boolean true 드로어 안의 첫 번째 포커스 가능한 요소에 포커스를 맞출지 여부예요. 2.24.2
block-scroll boolean true 활성 상태일 때 body 스크롤을 막을지 여부예요. 2.28.3
close-on-esc boolean true Esc 키를 눌렀을 때 드로어를 닫을지 여부예요. 2.24.2
content-class string undefined 드로어의 스크롤 가능한 콘텐츠 노드의 클래스예요. 2.37.0
content-style string | Object undefined 드로어의 스크롤 가능한 콘텐츠 노드의 스타일이에요.
default-width number | string 251 드로어의 기본 너비예요. placement가 left와 right일 때 동작해요. 2.31.0
default-height number | string 251 드로어의 기본 높이예요. placement가 top과 bottom일 때 동작해요. 2.31.0
display-directive 'if' | 'show' 'if' n-drawer를 렌더링할 때 사용하는 디스플레이 디렉티브예요. 'if'는 v-if, 'show'는 v-show에 대응해요.
height number | string undefined placement가 top과 bottom일 때 동작해요.
native-scrollbar boolean true 드로어에 네이티브 스크롤바를 쓸지 여부예요.
mask-closable boolean true 마스크를 클릭했을 때 hide 이벤트를 발생시킬지 여부예요.
max-width number undefined 드래그 가능한 드로어의 최대 너비예요. 2.35.0
max-height number undefined 드래그 가능한 드로어의 최대 높이예요. 2.35.0
min-width number undefined 드래그 가능한 드로어의 최소 너비예요. 2.35.0
min-height number undefined 드래그 가능한 드로어의 최대 높이예요. 2.35.0
placement 'top' | 'right' | 'bottom' | 'left' 'right' 드로어의 위치예요.
resizable boolean false 드로어의 너비/높이를 조절 가능하게 할지 여부예요. 2.31.0
scrollbar-props ScrollbarProps undefined Scrollbar props를 참고하세요.
show boolean false 드로어를 표시할지 여부예요.
show-mask boolean true 마스크를 표시할지 여부예요. 'transparent'로 지정하면 투명 마스크가 표시돼요. false로 지정하면 trap-focus가 비활성화돼요. 2.28.3
to string | HTMLElement 'body' 드로어의 컨테이너 노드예요.
trap-focus boolean true 포커스를 드로어 안에 가둘지(trap) 여부예요. 2.24.2
width number | string undefined placement가 left와 right일 때 동작해요.
z-index number undefined 드로어의 z-index예요. 2.24.0
on-after-enter () => void undefined 드로어가 열린 뒤에 호출되는 콜백이에요. 2.28.0
on-after-leave () => void undefined 드로어가 닫힌 뒤에 호출되는 콜백이에요. 2.28.0
on-esc () => void undefined Esc 키를 눌렀고 포커스가 드로어 안에 있을 때 발생하는 콜백이에요. 2.24.2
on-mask-click (e: MouseEvent) => void undefined 마스크를 클릭했을 때 발생하는 콜백이에요.
on-update:height (height: number) => void undefined 드로어 높이가 바뀔 때 발생하는 콜백이에요. 2.31.0
on-update:show (show: boolean) => void undefined 드로어의 표시 상태가 바뀔 때 발생하는 콜백이에요.
on-update:width (width: number) => void undefined 드로어 너비가 바뀔 때 발생하는 콜백이에요. 2.31.0

DrawerContent Props

이름 파라미터 기본값 설명 버전
body-class string undefined 드로어 콘텐츠 body의 클래스예요. 2.37.0
body-style string | Object undefined 드로어 콘텐츠 body의 스타일이에요.
body-content-class string undefined body의 스크롤 가능한 콘텐츠 노드의 클래스예요.
body-content-style string | Object undefined body의 스크롤 가능한 콘텐츠 노드의 스타일이에요. 2.37.0
closable boolean false 드로어 콘텐츠를 닫을 수 있는지 여부예요.
footer-class string undefined 드로어 콘텐츠 footer의 클래스예요. 2.37.0
footer-style string | Object undefined 드로어 콘텐츠 footer의 스타일이에요.
header-class string undefined 드로어 콘텐츠 header의 클래스예요. 2.37.0
header-style string | Object undefined 드로어 콘텐츠 header의 스타일이에요.
native-scrollbar boolean true body 부분에 네이티브 스크롤바를 쓸지 여부예요.
title string undefined 드로어 콘텐츠의 제목이에요.
scrollbar-props ScrollbarProps undefined Scrollbar props를 참고하세요.

Drawer Slots

이름 파라미터 설명
default () 드로어의 콘텐츠예요.

DrawerContent Slots

이름 파라미터 설명
default () 드로어 콘텐츠의 콘텐츠예요.
footer () 드로어 콘텐츠의 footer예요.
header () 드로어 콘텐츠의 header예요.

더 알아보기 (Learn more)

중앙에 뜨는 오버레이는 Modal 컴포넌트가 담당해요. 드로어와 모달 중 무엇을 쓸지 고민될 때는 두 컴포넌트의 placement 차이를 비교해 보세요.