diff options
| author | Fuwn <[email protected]> | 2021-02-21 18:30:25 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-21 18:30:25 -0800 |
| commit | 1a8d4449192b17c67f615faef44a1993efbac142 (patch) | |
| tree | 3732be235698b60ba71622a95da719bc2480de0f /src-tauri/src/main.rs | |
| download | tauri-vue-master.tar.xz tauri-vue-master.zip | |
Diffstat (limited to 'src-tauri/src/main.rs')
| -rw-r--r-- | src-tauri/src/main.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs new file mode 100644 index 0000000..e937ebc --- /dev/null +++ b/src-tauri/src/main.rs @@ -0,0 +1,30 @@ +#![cfg_attr( + all(not(debug_assertions), target_os = "windows"), + windows_subsystem = "windows" +)] + +mod cmd; + +fn main() { + tauri::AppBuilder::new() + .invoke_handler(|_webview, arg| { + use cmd::Cmd::*; + match serde_json::from_str(arg) { + Err(e) => { + Err(e.to_string()) + } + Ok(command) => { + match command { + // definitions for your custom commands from Cmd here + MyCustomCommand { argument } => { + // your command code + println!("{}", argument); + } + } + Ok(()) + } + } + }) + .build() + .run(); +} |