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

드래그

원문 보기 위키 갱신

드래그 (Drag)

아무 요소나 드래그로 끌어다 놓을 수 있게 만들어 주는 컴포넌트예요. 이동 방향 제한, 경계 제한, 모서리 자동 흡착(attract) 같은 동작도 옵션으로 켤 수 있어요.

출처: 문서

설치 (Install)

import { createApp } from 'vue'
import { Drag } from '@nutui/nutui'

const app = createApp()
app.use(Drag)

사용 예제 (Usage)

기본 사용법 (Basic Usage)

demo: drag basic

방향 제한 (Limit Direction)

demo: drag direction

끌림(자석) 효과 (Attract)

demo: drag attract

경계 제한 (Limit Boundary)

demo: drag boundary

API

Props

Attribute Description Type Default
attract Whether to enable automatic edge suction boolean false
direction The drag direction limit of the dragged element x, y, all string 'all'
boundary The drag boundary of the dragged element object {top: 0,left: 0,right: 0,bottom: 0}

더 알아보기 (Learn more)

이 글은 NutUI 공식 문서의 영문 원문을 한국어로 번역한 내용이에요. 최신 내용과 전체 문서는 아래 링크에서 확인할 수 있어요: