在 Cargo.toml
文件中配置 Tauri 时,通过 features
参数可以启用特定的功能或模块。以下是一些你可能会用到的 Tauri 的可选特性:
custom-protocol
macos-private-api
no-strip
system-tray
updater
devtools
cmdiw
global-shortcuts
根据 Tauri 的版本更新,可能还会引入更多可选特性和模块,你应该根据项目需要和 Tauri 的文档来选择启用哪些特性。
请注意,Cargo.toml
中的 features
数组应包含你想启用的特性名称,也就是 "custom-protocol"
、"macos-private-api"
这样的字符串,而不是一个空字符串 ""
。例如:
[dependencies]
tauri = { version = "2.2.4", features = ["custom-protocol", "updater"] }
以上示例启用了 custom-protocol
和 updater
特性。如果你想查看完整的可选特性列表,可以参考 Tauri 的 Cargo.toml
或其在线文档来进行更详细的了解。