clearNuxtState

原始檔
刪除 useState 的快取狀態。
如果您想使 useState 的狀態失效,此方法會很有用。

型別

簽名
export function clearNuxtState (keys?: string | string[] | ((key: string) => boolean)): void

引數

  • keys: 在 useState 中使用的一個或多個鍵,用於刪除其快取狀態。如果沒有提供鍵,所有狀態都將失效。