本文整理匯總了TypeScript中sp-pnp-js.storage.local.put方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript storage.local.put方法的具體用法?TypeScript storage.local.put怎麽用?TypeScript storage.local.put使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sp-pnp-js.storage.local
的用法示例。
在下文中一共展示了storage.local.put方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: Date
this.taxonomyModule.getNavigationTaxonomyNodes(new SP.Guid(termSetId)).then((navigationTree) => {
// Initialize the mainMenu view model
this.initialize(navigationTree);
this.wait(false);
const now: Date = new Date();
// Set the navigation tree in the local storage of the browser
storage.local.put(this.localStorageKey, this.utilityModule.stringifyTreeObject(navigationTree), new Date(now.setDate(now.getDate() + 7)));
}).catch((errorMesssage) => {
示例2: Date
this.taxonomyModule.getNavigationTaxonomyNodes(new SP.Guid(termSetId)).then((navigationTree: ITaxonomyNavigationNode[]) => {
// Initialize the mainMenu view model
this.initialize(navigationTree);
this.wait(false);
// Publish the data to all subscribers (contextual menu and breadcrumb)
PubSub.publish("navigationNodes", { nodes: navigationTree } );
const now: Date = new Date();
// Clear the local storage value
storage.local.delete(this.localStorageKey);
// Set the navigation tree in the local storage of the browser
storage.local.put(this.localStorageKey, this.utilityModule.stringifyTreeObject(navigationTree), new Date(now.setDate(now.getDate() + 7)));
}).catch((errorMesssage) => {