持續性範圍
儲存檔案系統和資源範圍,並在應用程式重新開啟時還原。
支援平台
此外掛程式需要至少 1.77.2 的 Rust 版本
平台 | 層級 | 註解 |
---|---|---|
windows | ||
linux | ||
macos | ||
android | ||
ios |
設定
安裝 persisted-scope 外掛程式以開始使用。
使用專案的套件管理器新增依賴
npm run tauri add persisted-scope
yarn run tauri add persisted-scope
pnpm tauri add persisted-scope
deno task tauri add persisted-scope
bun tauri add persisted-scope
cargo tauri add persisted-scope
-
在
src-tauri
資料夾中執行以下命令,將外掛程式新增至Cargo.toml
中專案的依賴項cargo add tauri-plugin-persisted-scope -
修改
lib.rs
以初始化外掛程式src-tauri/src/lib.rs #[cfg_attr(mobile, tauri::mobile_entry_point)]pub fn run() {tauri::Builder::default().plugin(tauri_plugin_persisted_scope::init()).run(tauri::generate_context!()).expect("error while running tauri application");}
用法
設定完成後,此外掛程式將自動儲存和還原檔案系統和資源範圍。
© 2025 Tauri 貢獻者。CC-BY / MIT