我正在尝试制作一个小的tauri应用程序,每个页面的顶部都有相同的菜单。我遵循了这个教程,“将菜单添加到所有窗口”部分。我可以看到菜单,我可以退出它的应用程序,但我无法找到如何去另一个hmtl页面时,剪裁。
我有这段代码,但我不知道把什么放在"accel“下面
.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
}
_ => {}
}
})有人知道怎么做吗?我找到了十几个带有菜单的示例代码,但没有一个显示了我要找的东西(或者我无法指出我需要的行)。
谢谢你的帮助!
发布于 2022-03-17 17:25:37
我终于从tauri的不和谐聊天中得到了答案,我希望它能对某人有用吗?
window.eval("window.location.replace('your.url')");做了这份工作
https://stackoverflow.com/questions/71429832
复制相似问题