Skip to content

Commit ec08d90

Browse files
Added use-style-cursor options to GridLayout.
1 parent 2b4d6a2 commit ec08d90

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

README-zh_CN.md

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

280280
设置每个断点对应的列数。
281281

282+
* **useStyleCursor**
283+
284+
* type: `Boolean`
285+
* required: `false`
286+
* default: `true`
287+
288+
标识是否使用动态鼠标指针样式。当拖动出现卡顿时,将此值设为 `false`也许可以缓解布局问题。
282289

283290
##### GridItem
284291

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ English | [简体中文](./README-zh_CN.md)
2424
- [Getting Started](#getting-started)
2525
- [Installation](#installation)
2626
- [npm](#npm)
27+
- [browser](#browser)
28+
- [Usage](#usage)
29+
- [Documentation](#documentation)
30+
- [Properties](#properties)
31+
- [GridLayout](#gridlayout)
32+
- [GridItem](#griditem)
33+
- [Events](#events)
2734
- [Contribute](#contribute)
2835
- [TODO List](#todo-list)
2936
@@ -301,6 +308,13 @@ Include the browser-ready bundle (download from [releases](https://github.com/jb
301308

302309
Defines number of columns for each breakpoint
303310

311+
* **useStyleCursor**
312+
313+
* type: `Boolean`
314+
* required: `false`
315+
* default: `true`
316+
317+
Says if set the `styleCursor` option to true. When dragging freezes, setting this value to `false` may alleviate problems.
304318

305319
##### GridItem
306320

src/components/GridItem.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@
203203
draggable: null,
204204
resizable: null,
205205
useCssTransforms: true,
206+
useStyleCursor: true,
206207
207208
isDragging: false,
208209
dragging: null,
@@ -312,6 +313,7 @@
312313
this.resizable = this.isResizable;
313314
}
314315
this.useCssTransforms = this.$parent.useCssTransforms;
316+
this.useStyleCursor = this.$parent.useStyleCursor;
315317
this.createStyle();
316318
},
317319
watch: {
@@ -738,6 +740,9 @@
738740
const self = this;
739741
if (this.interactObj === null || this.interactObj === undefined) {
740742
this.interactObj = interact(this.$refs.item);
743+
if (!this.useStyleCursor) {
744+
this.interactObj.styleCursor(false);
745+
}
741746
}
742747
if (this.draggable && !this.static) {
743748
const opts = {
@@ -762,6 +767,9 @@
762767
const self = this;
763768
if (this.interactObj === null || this.interactObj === undefined) {
764769
this.interactObj = interact(this.$refs.item);
770+
if (!this.useStyleCursor) {
771+
this.interactObj.styleCursor(false);
772+
}
765773
}
766774
if (this.resizable && !this.static) {
767775
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
@@ -106,6 +106,10 @@
106106
preventCollision: {
107107
type: Boolean,
108108
default: false
109+
},
110+
useStyleCursor: {
111+
type: Boolean,
112+
default: true
109113
}
110114
},
111115
data: function () {

0 commit comments

Comments
 (0)