---
name: "Animation.rotateY"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "Animation.rotateY - 在 Y 轴旋转一个角度"
---

## Animation.rotateY

> [VERSION] Base Library >= 2.21.8

### Description

Rotate by an angle around the Y axis

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `angle` | `number` | Yes | Rotation angle, range -180~180 |

### Return Value

Type: `Animation`

Animation instance

### Examples

#### Rotate around the Y axis

```ts
Page({
  data: {
    animationData: {},
  },
  onReady() {
    const animation = ty.createAnimation({ duration: 500 });
    animation.rotateY(60).step();
    this.setData({ animationData: animation.export() });
  },
});
```
