持久化作用域(Persisted Scope)
保存文件系统和资源作用域,并在应用重新打开时恢复它们。
- Windows
 - Linux
 - macOS
 
请安装 persistent-scope 插件。
- 在你的 
Cargo.toml文件中添加以下内容来安装插件。 
[dependencies]tauri-plugin-persisted-scope = "2.0.0"# 或者使用 Git:tauri-plugin-persisted-scope = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }- 修改 
lib.rs来初始化插件。 
fn run() {    tauri::Builder::default()        .plugin(tauri_plugin_persisted_scope::init())        .run(tauri::generate_context!())        .expect("error while running tauri application");}安装后,插件将自动保存和恢复文件系统和资源范围。
© 2025 Tauri Contributors. CC-BY / MIT