import * as React from "react"; import Moveable, { makeAble, MoveableManagerInterface } from "@/react-moveable"; const MouseEnterLeaveAble = makeAble("enterLeave", { mouseEnter(moveable: MoveableManagerInterface) { if (moveable.moveables) { // group moveable.moveables.forEach(child => { child.state.target!.style.backgroundColor = "#e55"; }); } else { // single moveable.state.target!.style.backgroundColor = "#e55"; } }, mouseLeave(moveable: MoveableManagerInterface) { if (moveable.moveables) { // group moveable.moveables.forEach(child => { child.state.target!.style.backgroundColor = ""; }); } else { // single moveable.state.target!.style.backgroundColor = ""; } }, }); export default function App() { const targetRef = React.useRef(null); return
Target1
Target2
Target3
{ e.target.style.transform = e.transform; }} /> { e.events.forEach(ev => { ev.target.style.transform = ev.transform; }); }} />
; }