<!--
source: https://blueos.niceshare.site/api/system/prompt/
site: 蓝河文档馆
summary: 弹窗 — 蓝河文档馆 BlueOS 开发文档
-->
---
title: '弹窗'
description: '```json'
lastUpdated: 2023-10-30T02:12:45.000Z
---

## 接口声明

```json
{ "name": "blueos.window.prompt" }
```

## 导入模块

```ts
import prompt from '@blueos.window.prompt' 或 const prompt = require('@blueos.window.prompt')
```

## 接口定义

### prompt.showToast(OBJECT)

显示 Toast

#### 参数：

| 参数名 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| message | String | 是 | 要显示的文本 |
| duration | Number | 否 | 0 为短时，1 为长时，默认 0 |

#### 示例：

```ts
prompt.showToast({
  message: 'message',
})
```
