filedragdrop.rs 347 B

1234567891011121314151617
  1. use dioxus::prelude::*;
  2. use dioxus_desktop::Config;
  3. fn main() {
  4. LaunchBuilder::new(app)
  5. .cfg(Config::new().with_file_drop_handler(|_w, e| {
  6. println!("{e:?}");
  7. true
  8. }))
  9. .launch_desktop()
  10. }
  11. fn app() -> Element {
  12. rsx!(
  13. div { h1 { "drag a file here and check your console" } }
  14. )
  15. }