Cell
Cell (셀)
리스트 안에서 하나의 표시 항목을 담당하는 컴포넌트예요. 설정 항목 목록이나 프로필 화면처럼 제목·설명·화살표를 한 줄로 나란히 보여 줄 때 자주 써요.
출처: 문서
본문
소개 (Intro)
Cell은 리스트에서 단일 표시 항목이에요.
설치 (Install)
import { createApp } from 'vue'
import { Cell, CellGroup } from '@nutui/nutui'
const app = createApp()
app.use(Cell)
app.use(CellGroup)
데모 (Demos)
아래 항목들은 원문 문서의 대화형 데모로 제공돼요.
- 기본 사용법 (Basic Usage) —
demo: cell basic - 큰 크기 (Size Large) —
demo: cell size - 기본 슬롯 (Default Slot) —
demo: cell slot - desc 슬롯 (Desc Slot)
v4.1.6—demo: cell desc - title 슬롯 (Title Slot) —
demo: cell title - CellGroup —
demo: cell group - link 슬롯 (Link Slot) —
demo: cell link - icon 슬롯 (Icon Slot) —
demo: cell icon - 왼쪽 정렬 (Align Left) —
demo: cell align - 수직 중앙 정렬 (Vertical Center) —
demo: cell center
수직 중앙 정렬 (Vertical Center)
center 속성으로 셀의 왼쪽과 오른쪽 콘텐츠를 수직으로 중앙 정렬할 수 있어요.
API
CellGroup Props
| Attribute | Description | Type | Default |
|---|---|---|---|
| title | Title | string | - |
| desc | Description | string | - |
Cell Props
| Attribute | Description | Type | Default |
|---|---|---|---|
| title | Title | string | - |
| sub-title | Subtitle | string | - |
| desc | Description | string | - |
| desc-text-align | Right description text alignment text-align | string | right |
| is-link | Whether to show the right arrow and turn on click feedback | boolean | false |
| round-radius | Corner radius | number | 6px |
| url | Link URL | string | - |
| to | Target route of the link, same as to of vue-router | string | object | - |
| replace | If true, the navigation will not leave a history record | boolean | false |
| center | Whether to center content vertically | boolean | false |
| size | Size, can be set to large |
string | '' |
Cell Events
| Event | Description | Arguments |
|---|---|---|
| click | Emitted when cell is clicked | event:Event |
Cell Slots
| Name | Description |
|---|---|
| icon | Custom Left icon |
| default | Default slot |
| link | Custom Right link |
| title | Custom title slot |
descv4.1.6 |
Custom desc slot |
CellGroup Slots
| Name | Description |
|---|---|
| title | Custom title slot |
| desc | Custom desc slot |
Types v4.3.5
컴포넌트는 다음 타입 정의를 export해요:
import type {
CellSize,
CellProps,
CellInstance
} from '@nutui/nutui';
Theming
CSS Variables
The component provides the following CSS variables, which can be used to customize styles. Please refer to ConfigProvider component.
| Name | Default Value |
|---|---|
| --nut-cell-color | var(--nut-title-color2) |
| --nut-cell-title-font | var(--nut-font-size-2) |
| --nut-cell-title-desc-font | var(--nut-font-size-1) |
| --nut-cell-desc-font | var(--nut-font-size-2) |
| --nut-cell-desc-color | var(--nut-disable-color) |
| --nut-cell-border-radius | 6px |
| --nut-cell-padding | 13px 16px |
| --nut-cell-line-height | 20px |
| --nut-cell-after-right | 16px |
| --nut-cell-after-border-bottom | 1px solid #f5f6f7 |
| --nut-cell-default-icon-margin | 0 4px 0 0px |
| --nut-cell-large-title-font | var(--nut-font-size-large) |
| --nut-cell-large-title-desc-font | var(--nut-font-size-base) |
| --nut-cell-large-padding | 15px 16px |
| --nut-cell-background | var(--nut-white) |
| --nut-cell-box-shadow | 0px 1px 7px 0px rgba(237, 238, 241, 1) |
| --nut-cell-group-title-padding | 0 10px |
| --nut-cell-group-title-color | #909ca4 |
| --nut-cell-group-title-font-size | var(--nut-font-size-2) |
| --nut-cell-group-title-line-height | 20px |
| --nut-cell-group-desc-padding | 0 10px |
| --nut-cell-group-desc-color | #909ca4 |
| --nut-cell-group-desc-font-size | var(--nut-font-size-1) |
| --nut-cell-group-desc-line-height | 16px |
| --nut-cell-group-background-color | var(--nut-white) |
더 알아보기 (Learn more)
- 원문 문서: Cell — NutUI v4 영문 문서
- NutUI 저장소: jd-opensource/nutui