말줄임
말줄임 (Ellipsis)
공간이 부족할 때 내용의 일부를 감추고 ...으로 대체해 보여 주는 컴포넌트예요. 한 줄뿐 아니라 여러 줄 말줄임도 지원하고, 펼치기·접기 기능도 붙일 수 있어요.
출처: 문서
설치 (Install)
import { createApp } from 'vue'
import { Ellipsis } from '@nutui/nutui'
const app = createApp()
app.use(Ellipsis)
사용 예제 (Usage)
시작 방향 (Start)
demo: ellipsis start
끝 방향 (End)
demo: ellipsis end
중간 (Middle)
demo: ellipsis middle
여러 줄 (Multi-line)
demo: ellipsis row
펼치기와 접기 (Expand & Collapse)
demo: ellipsis expand
API
Props
| Attribute | Description | Type | Default |
|---|---|---|---|
| content | Content | string | - |
| direction | Direction, start | end | middle |
string | end |
| rows | Rows | number | 1 |
| expand-text | Expand text | string | '' |
| collapse-text | Collapse text | string | '' |
| symbol | Symbol | string | ... |
| line-height | the row height of the container | string | number | 20 |
Events
| Event | Description | Arguments |
|---|---|---|
| click | Emitted when the content is clicked | - |
| change | Emitted when expand or collapse is clicked | expand or collapse |
테마 (Theming)
CSS 변수 (CSS Variables)
컴포넌트는 스타일을 커스터마이징할 때 쓸 수 있는 CSS 변수를 제공해요. 자세한 사용법은 ConfigProvider 컴포넌트 문서를 참고하세요.
| Name | Default Value |
|---|---|
| --nut-ellipsis-expand-collapse-color | #3460fa |
더 알아보기 (Learn more)
이 글은 NutUI 공식 문서의 영문 원문을 한국어로 번역한 내용이에요. 최신 내용과 전체 문서는 아래 링크에서 확인할 수 있어요:
- 원문 문서: ellipsis doc.en-US.md
- NutUI GitHub 저장소: https://github.com/jd-opensource/nutui