監(jiān)視應(yīng)用程序的性能,如果檢測(cè)到性能不佳,則顯示消息。
new PerformanceWatchdog(options)
Parameters:
options
(Object)
Name | Description |
---|---|
options.container
(Element | String)
|
將包含該小部件的DOM元素或ID。 |
options.scene
Scene
|
用于監(jiān)視性能的Scene 。
|
options.lowFrameRateMessage
String
default 'This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'
|
檢測(cè)到低幀速率時(shí)要顯示的消息。消息以HTML形式插入,因此請(qǐng)確保它來(lái)自受信任的源,這樣您的應(yīng)用程序就不會(huì)受到跨站點(diǎn)腳本攻擊的攻擊。 |
Members
container : Element
獲取父容器。
viewModel : PerformanceWatchdogViewModel
獲取視圖模型。
Methods
destroy()
銷(xiāo)毀小部件。如果從布局中永久刪除小部件,則應(yīng)調(diào)用。