Animate 애니메이션
Animate는 하위 요소에 애니메이션 효과를 더하는 컴포넌트예요. 11가지 타입의 애니메이션을 지원해요.
출처: 문서
설치
@nutui/nutui에서 컴포넌트를 가져와 앱에 등록하면 바로 쓸 수 있어요.
import { createApp } from 'vue'
import { Animate } from '@nutui/nutui'
const app = createApp()
app.use(Animate)
사용 예시
show로 애니메이션 트리거
demo: animate show
반복 애니메이션
demo: animate loop
클릭으로 트리거
demo: animate click
API
Props
| Attribute | Description | Type | Default |
|---|---|---|---|
showv4.1.1 |
Trigger animation when show changes from false to true |
boolean | false |
| type | For animation type, see the description of type value below | string | - |
| loop | Whether to execute circularly. true- loop execution; false- execute once |
boolean | false |
duration4.0.7 |
AnimationDuration, ms | number | string | - |
| action | Triggering method,initial- initialization execution; click- click to execute |
string | - |
Events
| Event | Description | Arguments |
|---|---|---|
animatev4.1.1 |
Trigger of animation | - |
| click | Triggered when an element is clicked | event: Event |
Type value description
| Order | Type name | Description |
|---|---|---|
| 1 | shake | shake,It is recommended that loop be true |
| 2 | ripple | ripple |
| 3 | breath | breath,It is recommended that loop be true |
| 4 | float | float,It is recommended that loop be true |
| 5 | slide-right | From right to left |
| 6 | slide-left | From left to right |
| 7 | slide-top | From top to bottom |
| 8 | slide-bottom | From bottom to top |
| 9 | jump | jump,It is recommended that loop be true |
| 10 | twinkle | twinkle,It is recommended that loop be true |
| 11 | flicker | Polish button,It is recommended that loop be true |
Types v4.3.2
이 컴포넌트는 아래 타입 정의를 함께 내보내요.
import type {
AnimateType,
AnimateAction,
AnimateProps,
AnimateInstance
} from '@nutui/nutui';
더 알아보기 (Learn more)
- 원문 문서: NutUI Animate 공식 문서(영문)
- NutUI는 JD.com이 공개한 Vue 3 모바일 컴포넌트 라이브러리예요. 전체 컴포넌트 목록은 공식 문서 사이트에서, 소스 코드는 GitHub 저장소에서 볼 수 있어요.