我们如何在 VSTS 小部件中显示忙碌指示器?
How do we show the busy indicator in a VSTS Widget?
我正在创建一个 VSTS 小部件,它也有一个配置小部件。我想知道如何设置忙碌指示器,因为数据呈现需要一些时间。
From the API: 它说明了 VSS.INIT 选项...
IExtensionInitializationOptions
Last Update: 1/24/2017
Defined in vss.d.ts
Options for the extension's initialization method
Members
explicitNotifyLoaded: boolean. Optional.
Set to true if the extension willexplicitly call notifyLoadSucceeded or
notifyLoadFailed itself to indicate that the extension is done loading
(stops UI loading indicator in the host). If false (the default) the
extension is considered ready as soon as init is called.
但是我们已经设置了这个选项如下:
VSS.init({
explicitNotifyLoaded: true,
usePlatformStyles: true,
usePlatformScripts: true
我们从未看到 UI 加载指示器。
请指教
VSS.init()
用于与主机 window 执行初始 handshake/setup。当使用 explicitNotifyLoaded
表示我们将在扩展加载完成时手动通知主机。这用于加载指示器。 VSS.notifyLoadSucceeded()
稍后调用以指示已加载扩展。
所以请确保稍后调用VSS.notifyLoadSucceeded()
,以便系统知道您已完成。
也尝试使用 ready() 方法,该方法 注册一个回调,一旦初始 setup/handshake 完成 就会调用该回调。一些示例供您参考:
我正在创建一个 VSTS 小部件,它也有一个配置小部件。我想知道如何设置忙碌指示器,因为数据呈现需要一些时间。
From the API: 它说明了 VSS.INIT 选项...
IExtensionInitializationOptions
Last Update: 1/24/2017
Defined in vss.d.ts
Options for the extension's initialization method
Members
explicitNotifyLoaded: boolean. Optional.
Set to true if the extension willexplicitly call notifyLoadSucceeded or
notifyLoadFailed itself to indicate that the extension is done loading
(stops UI loading indicator in the host). If false (the default) the
extension is considered ready as soon as init is called.
但是我们已经设置了这个选项如下:
VSS.init({
explicitNotifyLoaded: true,
usePlatformStyles: true,
usePlatformScripts: true
我们从未看到 UI 加载指示器。
请指教
VSS.init()
用于与主机 window 执行初始 handshake/setup。当使用 explicitNotifyLoaded
表示我们将在扩展加载完成时手动通知主机。这用于加载指示器。 VSS.notifyLoadSucceeded()
稍后调用以指示已加载扩展。
所以请确保稍后调用VSS.notifyLoadSucceeded()
,以便系统知道您已完成。
也尝试使用 ready() 方法,该方法 注册一个回调,一旦初始 setup/handshake 完成 就会调用该回调。一些示例供您参考: