filedragdrop.rs 349 B

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