import * as React from "react"; import Moveable from "@/react-moveable"; export default function App(props: Record) { const widthInputRef = React.useRef(null); const heightInputRef = React.useRef(null); const moveableRef = React.useRef(null); const onInput = (e: any) => { const ev = (e.nativeEvent || e) as InputEvent; if (typeof ev.data === "undefined") { moveableRef.current!.request("resizable", { offsetWidth: parseFloat(widthInputRef.current!.value), offsetHeight: parseFloat(heightInputRef.current!.value), }, true); } }; const onKeyUp = (e: any) => { e.stopPropagation(); // enter if (e.keyCode === 13) { moveableRef.current!.request("resizable", { offsetWidth: parseFloat(widthInputRef.current!.value), offsetHeight: parseFloat(heightInputRef.current!.value), }, true); } }; return
width:   height:
Target1
{ e.target.style.width = `${e.width}px`; e.target.style.height = `${e.height}px`; e.target.style.transform = e.drag.transform; }} onResizeEnd={(e) => { requestAnimationFrame(() => { const rect = e.moveable.getRect(); widthInputRef.current!.value = `${rect.offsetWidth}`; heightInputRef.current!.value = `${rect.offsetHeight}`; }); }} />
; }