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

TrendArrow 추세 화살표

원문 보기 위키 갱신

TrendArrow는 값의 상승·하락을 화살표로 보여주는 컴포넌트예요. 주식·지표처럼 방향이 중요한 수치 옆에 붙이면 좋아요.

출처: 문서

본문

설치

@nutui/nutui에서 컴포넌트를 가져와 앱에 등록하면 바로 쓸 수 있어요.

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

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

사용 예시

기본 사용법

demo: trendarrow basic

소수점 자릿수 지정

demo: trendarrow digits

화살표를 앞에 두기

demo: trendarrow left

부호 표시

demo: trendarrow sign

0 표시 여부

demo: trendarrow zero

색상 커스터마이즈

demo: trendarrow color

아이콘 커스터마이즈

::: demo

demo: trendarrow icon

API

Props

Attribute Description Type Default
rate Value, the arrow is up when it is greater than 0, and the arrow is down when it is less than 0 number -
digits decimal precision number 2
show-sign Whether to display plus and minus signs boolean false
show-zero whether to show 0 boolean false
arrow-left whether to show an arrow to the left of the number boolean false
sync-text-color Whether the text color is in sync with the arrow boolean true
text-color text color string #333333
rise-color up arrow color string #fa2c19
drop-color down arrow color string #64b578

Slots

Name Description
up-icon custom up icon
down-icon custom down icon

Types v4.3.4

이 컴포넌트는 아래 타입 정의를 함께 내보내요.

import type {
  TrendArrowProps,
  TrendArrowInstance
} from '@nutui/nutui'

Theming

CSS Variables

스타일 커스텀에 쓸 수 있는 CSS 변수를 제공해요. 자세한 내용은 ConfigProvider 컴포넌트를 참고하세요.

Name Default Value
--nut-trendarrow-font-size 14px
--nut-trendarrow-before-icon-margin 4px

더 알아보기 (Learn more)