as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
跳转到主要内容
Launches an alert dialog with the specified title and message. Optionally provide a list of buttons. Tapping any button will fire the respective onPress callback and dismiss the alert. By default, the only button will be an ‘OK’ button.

Example

Vega

Vega mimics the behavior of Android’s alert with at most three buttons and its positive/negative/neutral semantics.
  • If you specify one button, it will be the ‘positive’ one (such as ‘OK’)
  • Two buttons mean ‘negative’, ‘positive’ (such as ‘Cancel’, ‘OK’)
  • Three buttons mean ‘neutral’, ‘negative’, ‘positive’ (such as ‘Later’, ‘Cancel’, ‘OK’)
The alert may be dismissed by providing an optional AlertOptions parameter with the cancelable property set to true i.e. {cancelable: true}. The cancel event can be handled by providing an onDismiss callback property inside the options parameter.

Example


Reference

Methods

alert()

Parameters:

Type definitions

AlertButton

An object describing the configuration of a button in the alert. Objects properties:

AlertOptions

Properties:
最后修改于 2026年10月26日