스티키
스티키 (Sticky)
고정 위치(fixed positioning)를 활용해 position: sticky와 비슷한 천장 고정 효과를 만들어 주는 컴포넌트예요. 위·아래 방향 중 어디에 붙일지, 어느 지점에서 고정할지 정할 수 있어요.
출처: 문서
본문
설치 (Install)
import { createApp } from 'vue'
import { Sticky } from '@nutui/nutui'
const app = createApp()
app.use(Sticky)
사용 예제 (Usage)
기본 사용법 (Basic Usage)
demo: sticky basic
상단 거리 (Top Distance)
demo: sticky top
컨테이너 커스텀 (Custom Container)
demo: sticky container
하단 거리 (Bottom Distance)
demo: sticky bottom
API
Props
| Attribute | Description | Type | Default |
|---|---|---|---|
| position | Adsorption position(top、bottom) |
string | top |
| top | Ceiling distance, enable when position = top |
number | 0 |
| bottom | Suction distance, enable when position = bottom |
number | 0 |
| container | The 'HTML' node of the container | Element | - |
| z-index | Level of adsorption | number | 99 |
Events
| Event | Description | Arguments |
|---|---|---|
| change | Triggered when the adsorption state changes | fixed: boolean |
더 알아보기 (Learn more)
이 글은 NutUI 공식 문서의 영문 원문을 한국어로 번역한 내용이에요. 최신 내용과 전체 문서는 아래 링크에서 확인할 수 있어요:
- 원문 문서: sticky doc.en-US.md
- NutUI GitHub 저장소: https://github.com/jd-opensource/nutui