Skip to content

Commit 514de88

Browse files
committed
new events emited by GridLayout, release 2.3.4
1 parent 891bbd2 commit 514de88

12 files changed

+153
-33
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Changelog
22

3-
## 2.3.4 (UNRELEASED)
3+
## 2.3.4 (Mar 5, 2019)
44

55
* Support for static items (thanks [panjiangyi](https://github.com/panjiangyi)).
66
* RTL bugfix (thanks [irvingwa](https://github.com/irvingwa)).
77
* Memory leak fixes (thanks [aiankile](https://github.com/aiankile)).
88
* Fixed exception on grid layout mount (thanks [BenoitZugmeyer](https://github.com/BenoitZugmeyer)).
99
* Fixed overlapping and resizing bugs on responsive mode (thanks [shpfive](https://github.com/shpfive)).
10+
* Added new events emited by GridLayout (layout-created, layout-before-mount, layout-mounted, layout-ready) (thanks [samuelmolinski](https://github.com/samuelmolinski)).
1011

1112
## 2.3.3 (Dec 26, 2018)
1213

README.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
vue-grid-layout is a grid layout system, like [Gridster](http://dsmorse.github.io/gridster.js/), for Vue.js. **Heavily inspired in [React-Grid-Layout](https://github.com/STRML/react-grid-layout)**
88

9-
### **Current version:** 2.3.3 (Supports Vue 2.2+)
9+
### **Current version:** 2.3.4 (Supports Vue 2.2+)
1010

1111
### **For Vue 2.1.10 and below use version [2.1.3](https://github.com/jbaysolutions/vue-grid-layout/tree/2.1.3)**
1212
### **For Vue 1 use version [1.0.3](https://github.com/jbaysolutions/vue-grid-layout/tree/1.0.3)**
@@ -451,6 +451,10 @@ Working example [here](https://jbaysolutions.github.io/vue-grid-layout/examples/
451451
:vertical-compact="true"
452452
:margin="[10, 10]"
453453
:use-css-transforms="true"
454+
@layout-created="layoutCreatedEvent"
455+
@layout-before-mount="layoutBeforeMountEvent"
456+
@layout-mounted="layoutMountedEvent"
457+
@layout-ready="layoutReadyEvent"
454458
@layout-updated="layoutUpdatedEvent"
455459
>
456460

@@ -469,6 +473,54 @@ Working example [here](https://jbaysolutions.github.io/vue-grid-layout/examples/
469473
</grid-layout>
470474
````
471475

476+
* **layoutCreatedEvent**
477+
478+
Layout created event
479+
480+
Emited on the component created lifecycle hook
481+
482+
```javascript
483+
layoutCreatedEvent: function(newLayout){
484+
console.log("Created layout: ", newLayout)
485+
}
486+
```
487+
488+
* **layoutBeforeMountEvent**
489+
490+
Layout beforeMount event
491+
492+
Emited on the component beforeMount lifecycle hook
493+
494+
```javascript
495+
layoutBeforeMountEvent: function(newLayout){
496+
console.log("beforeMount layout: ", newLayout)
497+
}
498+
```
499+
500+
* **layoutMountedEvent**
501+
502+
Layout mounted event
503+
504+
Emited on the component mounted lifecycle hook
505+
506+
```javascript
507+
layoutMountedEvent: function(newLayout){
508+
console.log("Mounted layout: ", newLayout)
509+
}
510+
```
511+
512+
* **layoutReadyEvent**
513+
514+
Layout ready event
515+
516+
Emited when all the operations on the mount hook finish
517+
518+
```javascript
519+
layoutReadyEvent: function(newLayout){
520+
console.log("Ready layout: ", newLayout)
521+
}
522+
```
523+
472524
* **layoutUpdatedEvent**
473525

474526
Layout updated event

dist/vue-grid-layout.common.js

Lines changed: 14 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-grid-layout.common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-grid-layout.umd.js

Lines changed: 14 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-grid-layout.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-grid-layout.umd.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-grid-layout.umd.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/02-events.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ <h1>Vue Grid Layout Example 2 - Move and resize events</h1>
4545
:is-resizable="true"
4646
:vertical-compact="true"
4747
:use-css-transforms="true"
48+
@layout-created="layoutCreatedEvent"
49+
@layout-before-mount="layoutBeforeMountEvent"
50+
@layout-mounted="layoutMountedEvent"
51+
@layout-ready="layoutReadyEvent"
52+
@layout-updated="layoutUpdatedEvent"
4853
>
4954
<grid-item v-for="item in layout"
5055
:x="item.x"
@@ -68,4 +73,4 @@ <h1>Vue Grid Layout Example 2 - Move and resize events</h1>
6873
<script src="../dist/vue-grid-layout.umd.min.js"></script>
6974
<script src="02-events.js"></script>
7075
</body>
71-
</html>
76+
</html>

examples/02-events.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,27 @@ new Vue({
7272
this.eventLog.push(msg);
7373
console.log(msg);
7474
},
75+
76+
layoutCreatedEvent: function(newLayout){
77+
this.eventLog.push("Created layout");
78+
console.log("Created layout: ", newLayout)
79+
},
80+
layoutBeforeMountEvent: function(newLayout){
81+
this.eventLog.push("beforeMount layout");
82+
console.log("beforeMount layout: ", newLayout)
83+
},
84+
layoutMountedEvent: function(newLayout){
85+
this.eventLog.push("Mounted layout");
86+
console.log("Mounted layout: ", newLayout)
87+
},
88+
layoutReadyEvent: function(newLayout){
89+
this.eventLog.push("Ready layout");
90+
console.log("Ready layout: ", newLayout)
91+
},
92+
layoutUpdatedEvent: function(newLayout){
93+
this.eventLog.push("Updated layout");
94+
console.log("Updated layout: ", newLayout)
95+
},
7596
}
7697
});
7798

0 commit comments

Comments
 (0)