[英]Set system tray menu items to disabled when starting Tauri tray app
[英]Tauri : How to open webpage when cliking on the menu
我正在嘗試制作一個小的 tauri 應用程序,每個頁面的頂部都有相同的菜單。 我遵循了本教程的“將菜單添加到所有窗口”部分。 我可以看到菜單,我可以用它退出應用程序,但我無法找到如何在點擊時將 go 轉到另一個 hmtl 頁面。
我有這段代碼,但我不知道在“加速”下放什么
.on_menu_event(|event| {
match event.menu_item_id() {
"quit" => {
std::process::exit(0);
}
"close" => {
event.window().close().unwrap();
}
"accel" => {
//not working, as you can imagine
//tauri::WindowUrl::App("index.html".into());
//I would like tauri to display index.html in the main window
}
_ => {}
}
})
有人知道如何做到這一點嗎? 我找到了很多帶有菜單的示例代碼,但沒有一個顯示我正在尋找的內容(或者我無法指出我需要的行)
謝謝你的幫助 !
我終於從tauri discord聊天中得到了答案,我希望它對某人有用?
window.eval("window.location.replace('your.url')");
做了這份工作
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.