zydx-plus 1.35.509 → 1.35.511

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zydx-plus",
3
- "version": "1.35.509",
3
+ "version": "1.35.511",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -261,7 +261,9 @@ export default {
261
261
  that.dragTap()
262
262
  },
263
263
  move (event) {
264
- that.y = event.rect.top
264
+ // 获取滚动距离
265
+ const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
266
+ that.y = event.rect.top - scrollTop
265
267
  that.x = event.rect.left
266
268
  if (that.x < -that.footRightOffset / 2) {
267
269
  that.x = -that.footRightOffset / 2
@@ -300,7 +302,7 @@ export default {
300
302
  if (this.direction === 'd') {
301
303
  this.footDownOffset = event.clientY - this.y;
302
304
  } else if (this.direction === 'in') {
303
- this.footDownOffset = event.clientX - this.x;
305
+ this.footDownOffset = event.clientY - this.y;
304
306
  this.footRightOffset = event.clientX - this.x;
305
307
  } else if (this.direction === 'r') {
306
308
  this.footRightOffset = event.clientX - this.x;
@@ -267,7 +267,9 @@ export default {
267
267
  interact(`#draggable${that.id}`).draggable({
268
268
  listeners: {
269
269
  move (event) {
270
- that.y = event.rect.top
270
+ // 获取滚动距离
271
+ const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
272
+ that.y = event.rect.top - scrollTop
271
273
  that.x = event.rect.left
272
274
  if (that.x < -that.footRightOffset / 2) {
273
275
  that.x = -that.footRightOffset / 2
@@ -306,7 +308,7 @@ export default {
306
308
  if (this.direction === 'd') {
307
309
  this.footDownOffset = event.clientY - this.y;
308
310
  } else if (this.direction === 'in') {
309
- this.footDownOffset = event.clientX - this.x;
311
+ this.footDownOffset = event.clientY - this.y;
310
312
  this.footRightOffset = event.clientX - this.x;
311
313
  } else if (this.direction === 'r') {
312
314
  this.footRightOffset = event.clientX - this.x;
package/src/index.js CHANGED
@@ -89,7 +89,7 @@ function install(app) {
89
89
  }
90
90
 
91
91
  export default {
92
- version: '1.35.509',
92
+ version: '1.35.511',
93
93
  install,
94
94
  Calendar,
95
95
  Message,