Skip to content

Commit f0f2b8a

Browse files
authored
Merge pull request jbaysolutions#484 from jbaysolutions/pr/458
Added use-style-cursor options to GridLayout.
2 parents 984c378 + 908bba7 commit f0f2b8a

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

README-zh_CN.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,13 @@ Also check https://cli.vuejs.org/guide/build-targets.html#library
287287

288288
设置每个断点对应的列数。
289289

290+
* **useStyleCursor**
291+
292+
* type: `Boolean`
293+
* required: `false`
294+
* default: `true`
295+
296+
标识是否使用动态鼠标指针样式。当拖动出现卡顿时,将此值设为 `false`也许可以缓解布局问题。
290297

291298
##### GridItem
292299

src/components/GridItem.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@
208208
draggable: null,
209209
resizable: null,
210210
useCssTransforms: true,
211+
useStyleCursor: true,
211212
212213
isDragging: false,
213214
dragging: null,
@@ -317,6 +318,7 @@
317318
this.resizable = this.isResizable;
318319
}
319320
this.useCssTransforms = this.layout.useCssTransforms;
321+
this.useStyleCursor = this.layout.useStyleCursor;
320322
this.createStyle();
321323
},
322324
watch: {
@@ -743,6 +745,9 @@
743745
const self = this;
744746
if (this.interactObj === null || this.interactObj === undefined) {
745747
this.interactObj = interact(this.$refs.item);
748+
if (!this.useStyleCursor) {
749+
this.interactObj.styleCursor(false);
750+
}
746751
}
747752
if (this.draggable && !this.static) {
748753
const opts = {
@@ -767,6 +772,9 @@
767772
const self = this;
768773
if (this.interactObj === null || this.interactObj === undefined) {
769774
this.interactObj = interact(this.$refs.item);
775+
if (!this.useStyleCursor) {
776+
this.interactObj.styleCursor(false);
777+
}
770778
}
771779
if (this.resizable && !this.static) {
772780
let maximum = this.calcPosition(0,0,this.maxW, this.maxH);

src/components/GridLayout.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@
107107
preventCollision: {
108108
type: Boolean,
109109
default: false
110+
},
111+
useStyleCursor: {
112+
type: Boolean,
113+
default: true
110114
}
111115
},
112116
data: function () {

0 commit comments

Comments
 (0)