fix(examples): Update web example to latest dialog plugin (#8567)

This commit is contained in:
Fabian-Lars
2024-01-09 01:03:23 +01:00
committed by GitHub
parent 97e3341299
commit 5cb196976e
4 changed files with 2306 additions and 860 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -4,3 +4,8 @@ members = [
"tauri",
"wasm"
]
resolver = "2"
# Patching the dialog plugin to use the local copy of tauri
[patch.crates-io]
tauri = { path = "../../../core/tauri" }

View File

@@ -15,7 +15,7 @@ tauri-build = { path = "../../../../core/tauri-build", features = [] }
[dependencies]
api = { path = "../api" }
tauri = { path = "../../../../core/tauri" }
tauri-plugin-dialog = "2.0.0-alpha.2"
tauri-plugin-dialog = "2.0.0-alpha.7"
[features]
custom-protocol = ["tauri/custom-protocol"]

View File

@@ -3,13 +3,18 @@
// SPDX-License-Identifier: MIT
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use tauri_plugin_dialog::DialogExt;
use tauri_plugin_dialog::{DialogExt, MessageDialogBuilder};
#[tauri::command]
fn greet(window: tauri::Window, name: String) {
MessageDialogBuilder::new(window.dialog(), "Tauri Example")
.parent(&window)
.show();
async fn greet(window: tauri::Window, name: String) -> bool {
MessageDialogBuilder::new(
window.dialog().to_owned(),
"Tauri Example",
format!("Hello {name}"),
)
.parent(&window)
.blocking_show()
}
fn main() {