FixedNav 고정 내비게이션
FixedNav는 화면 가장자리에 떠 있는 빠른 내비게이션 컴포넌트예요. 목록을 접었다 폈다 하면서 쓰는 '스토우(stow) 경험' 인터랙션을 제공하죠.
출처: 문서
설치
@nutui/nutui에서 컴포넌트를 가져와 앱에 등록하면 바로 쓸 수 있어요.
import { createApp } from 'vue'
import { FixedNav } from '@nutui/nutui'
const app = createApp()
app.use(FixedNav)
사용 예시
기본 사용법
demo: fixednav basic
왼쪽 배치 효과
demo: fixednav left
마스크 없이
demo: fixednav overlay
drag로 드래그 지원
demo: fixednav drag
커스텀 사용
demo: fixednav custom
API
Props
| Attribute | Description | Type | Default |
|---|---|---|---|
| visible | visible is | boolean | false |
| nav-list | Suspended list content data | Array | [] |
| active-color | list active button color | string | #fa2c19 Inherit theme color |
| active-text | Stow list button copy | string | Close Nav |
| un-active-text | Expand list button copy | string | Open Nav |
| type | Navigation direction, optional value left right |
string | right |
| overlay | Whether to display the mask when expanding | boolean | true |
| position | fixed Vertical position |
object | {top: 'auto',bottom: 'auto'} |
Events
| Event | Description | Arguments |
|---|---|---|
| selected | Triggered after selection | {item:item,$event:Event} |
Slots
| Name | Description |
|---|---|
| btn | slot custom button |
| list | slot custom expanded list content |
Theming
CSS Variables
스타일 커스텀에 쓸 수 있는 CSS 변수를 제공해요. 자세한 내용은 ConfigProvider 컴포넌트를 참고하세요.
| Name | Default Value |
|---|---|
| --nut-fixednav-bg-color | var(--nut-white) |
| --nut-fixednav-font-color | var(--nut-black) |
| --nut-fixednav-index | 201 |
| --nut-fixednav-btn-bg | linear-gradient(135deg, var(--nut-primary-color) 0%, var(--nut-primary-color-end) 100%) |
| --nut-fixednav-item-active-color | var(--nut-primary-color) |
더 알아보기 (Learn more)
- 원문 문서: NutUI FixedNav 공식 문서(영문)
- NutUI는 JD.com이 공개한 Vue 3 모바일 컴포넌트 라이브러리예요. 전체 컴포넌트 목록은 공식 문서 사이트에서, 소스 코드는 GitHub 저장소에서 볼 수 있어요.