i在JavaScript中编写Windows 10应用程序,并且知道,有一些限制。如果我查看Jumplists的文档,Microsoft只需写入»以获取有关创建或访问此对象的信息,请参见备注。
那么如何在UWP Windows 10应用中添加Jumplist,如何添加和删除ListItems?
它与C#代码非常相似。
您可以在这里找到一个示例:https://github.com/microsoft/windows-universal-samples/tree/master/samples/jumplist/js/js/js
基本代码是:
var Uri = Windows.Foundation.Uri;
var StartScreen = Windows.UI.StartScreen;
var JumpList = StartScreen.JumpList;
var JumpListItem = StartScreen.JumpListItem;
var item = JumpListItem.createWithArguments("key", "caption");
item.description = "Description";
item.groupName = GroupName.value;
item.logo = new Uri("ms-appx:///images/your-images.png");
jumpList.items.append(item);
jumpList.saveAsync();