Closed ys2rice2yangsong closed 8 months ago
use web_sys::{ Event, MouseEvent, wasm_bindgen::JsCast};
let contextmenu = move |e: Event| { e.prevent_default();
let event = e.value_of()
.dyn_into::<MouseEvent>().unwrap();
let x = event.client_x();
let y = event.client_y();
console!(format!("鼠标位置:x==={},y==={}",x,y));
};
I'm not sure what the question is here. Is it about creating a custom context menu in sycamore instead of the default browser one? It should be exactly the same as it is done in JS except using web-sys
so I'm going to close this issue for now since it is not really related to Sycamore per se.
Is there a case of a right-click pop-up menu?