fix: 修改moadl定义 style 高度与拖拽后,点击拖拽飘移的问题
This commit is contained in:
parent
792b5a1a42
commit
a2c5781120
1 changed files with 2 additions and 1 deletions
|
@ -199,8 +199,9 @@
|
|||
let style = {};
|
||||
|
||||
if (this.draggable) {
|
||||
let customTop = this.styles.top ? parseFloat(this.styles.top) : 0
|
||||
if (this.dragData.x !== null) style.left = `${this.dragData.x}px`;
|
||||
if (this.dragData.y !== null) style.top = `${this.dragData.y}px`;
|
||||
if (this.dragData.y !== null) style.top = `${this.dragData.y - customTop}px`;
|
||||
const width = parseInt(this.width);
|
||||
const styleWidth = {
|
||||
width: width <= 100 ? `${width}%` : `${width}px`
|
||||
|
|
Loading…
Add table
Reference in a new issue