as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
跳转到主要内容

Example


Reference

Properties

constants

Returns an object which contains all available common and specific constants related to the platform. Properties:

isTV

Returns a boolean which defines if device is a TV.

isTesting

Returns a boolean which defines if application is running in Developer Mode with testing flag set.

OS

Returns string value representing the current OS.

Methods

select

Returns the most fitting value for the platform you are currently running on.

Parameters:

Select method returns the most fitting value for the platform you are currently running on. If not specified, kepler key then native key will be used and then the default key. The config parameter is an object with the following keys:
  • kepler (any)
  • native (any)
  • default (any)
Example usage:
This will result in a container having flex: 1 on all platforms a yellow background on Vega and a blue background color on other platforms. Since the value of the corresponding platform key can be of type any, select method can also be used to return platform-specific components, like below: Since the value of the corresponding platform key can be of type any, select method can also be used to return platform-specific components, like below:
最后修改于 2026年10月26日