mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
fix(examples): Update web example to latest dialog plugin (#8567)
This commit is contained in:
3144
examples/web/core/Cargo.lock
generated
3144
examples/web/core/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -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" }
|
||||
@@ -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"]
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user