# context.deck

## navigate()

生成屏幕导航结果。在动作处理函数中返回这个结果，飞块就会切换触发动作的设备屏幕。

```ts
context.deck.navigate(target: 'next' | 'previous' | 'home' | { screenId: string }):
  Readonly<{ type: 'deck.navigation'; target: typeof target }>
```

### 参数

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| `target` | `string 或 object` | `next` 下一屏、`previous` 上一屏、`home` 主屏；指定屏幕时传入 `{ screenId }`。 |

### 返回值

返回一个导航对象，方法本身不执行切换。通过按钮或流程调用这个动作时，飞块根据触发设备执行导航。

### 示例

```js
definePlugin({
  actions: {
    nextScreen(args, context) {
      return context.deck.navigate("next");
    }
  }
});
```
