Vue.js <v-rect> 组件位置控制:如何移动矩形?
在 Vue.js 中,
例如,你可以使用以下代码来移动矩形:
this.imgRect = {
x: minPoint.x,
y: minPoint.y - dy * 1000 * this.rate,
width: dx * 1000 * this.rate,
height: dy * 1000 * this.rate,
dash: [10, 2],
stroke: 'white'
};
this.rect.position({ x: pos.x, y: pos.y });
这段代码将矩形的位置设置为 (pos.x, pos.y)。如果你想移动矩形,你需要修改 pos.x 和 pos.y 的值。
原文地址: https://www.cveoy.top/t/topic/fm6z 著作权归作者所有。请勿转载和采集!