moveable
moveable copied to clipboard
Question: Moveable resize event how to calculate the target top and left ?
Environments
- Framework name: Vue
- Framework version: 2.6.13
- Moveable Component version: 0.27.2
- Testable Address(optional):
Description
Hi @daybrush , when i resize the target, the demo use css tanslate change the target position,
target.style.transform = `translate(${beforeTranslate[0]}px, ${beforeTranslate[1]}px)`;
but i want to get the target top and left to change position how can i calculate the top and left according to resize event params?
@chenp1204 The drag property has top left information.
const width = e.width;
const height = e.height;
const top = e.drag.top;
const left = e.drag.left;
e.target.style.cssText += `width: ${width}px; height: ${height}px; left: ${left}px; top: ${top}px`;
Would be great if this would become part of the "How to use" example of the Readme.