filedragdrop.rs 378 B

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