Skip to content

Commit 0438d9a

Browse files
authored
Merge branch 'master' into master
2 parents 4ccd949 + 436ebd2 commit 0438d9a

18 files changed

+232
-35399
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 2.3.8 (July 31, 2020)
4+
5+
* Make margins reactive (thanks [yfwz100](https://github.com/yfwz100))
6+
* Added missing 'layout-updated' events (thanks [ben-lau](https://github.com/ben-lau))
7+
* Support for initial responsive layouts and breakpoint change event (thanks [ftylitak](https://github.com/ftylitak))
8+
* Bugfix for possible error when layout items get removed and interactObj is not set (thanks [Tofandel](https://github.com/Tofandel))
9+
* Fix wrong grid item sorting in responsive mode (thanks [pieterbeulque](https://github.com/pieterbeulque))
10+
311
## 2.3.7 (Oct 31, 2019)
412

513
* renamed 'resized' event emitted when the container changes size (browser window or other), introduced in #337, fixes #358

README-zh_CN.md

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

77
vue-grid-layout是一个类似于[Gridster](http://dsmorse.github.io/gridster.js/)的栅格布局系统, 适用于Vue.js。 **灵感源自于 [React-Grid-Layout](https://github.com/STRML/react-grid-layout)**
88

9-
### **当前版本:** 2.3.7 (支持 Vue 2.2+)
9+
### **当前版本:** 2.3.8 (支持 Vue 2.2+)
1010

1111
### **Vue 2.1.10 及以下请使用 [2.1.3](https://github.com/jbaysolutions/vue-grid-layout/tree/2.1.3)**
1212
### **Vue 1 请使用 [1.0.3](https://github.com/jbaysolutions/vue-grid-layout/tree/1.0.3)**

README.md

Lines changed: 30 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 by [React-Grid-Layout](https://github.com/STRML/react-grid-layout)**
88

9-
### **Current version:** 2.3.7 (Supports Vue 2.2+)
9+
### **Current version:** 2.3.8 (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)**
@@ -175,6 +175,16 @@ Include the browser-ready bundle (download from [releases](https://github.com/jb
175175

176176
The value must be an `Array` of `Object` items. Each item must have `i`, `x`, `y`, `w` and `h` properties. Please refer to the documentation for `GridItem` below for more information.
177177

178+
* **responsiveLayouts**
179+
180+
* type: `Object`
181+
* required: `false`
182+
* default : `{}`
183+
184+
This is the initial layouts of the grid per breakpoint if `responsive` is set to `true`.
185+
The keys of the `Object` are breakpoint names and each value is an `Array` of `Object` items as defined by `layout` prop. eg:{ lg:[layout items], md:[layout items] }.
186+
Setting the prop after the creation of the GridLayout has no effect.
187+
178188
* **colNum**
179189

180190
* type: `Number`
@@ -469,6 +479,7 @@ Working example [here](https://jbaysolutions.github.io/vue-grid-layout/examples/
469479
@layout-mounted="layoutMountedEvent"
470480
@layout-ready="layoutReadyEvent"
471481
@layout-updated="layoutUpdatedEvent"
482+
@breakpoint-changed="breakpointChangedEvent"
472483
>
473484

474485
<grid-item v-for="item in layout"
@@ -626,6 +637,24 @@ Working example [here](https://jbaysolutions.github.io/vue-grid-layout/examples/
626637
},
627638
```
628639

640+
* **breakpointChangedEvent**
641+
642+
Breakpoint Changed event
643+
644+
Every time the breakpoint value changes due to window resize
645+
646+
```javascript
647+
/**
648+
*
649+
* @param newBreakpoint the breakpoint name
650+
* @param newLayout the chosen layout for the breakpoint
651+
*
652+
*/
653+
breakpointChangedEvent: function(newBreakpoint, newLayout){
654+
console.log("BREAKPOINT CHANGED breakpoint=", newBreakpoint, ", layout: ", newLayout );
655+
},
656+
```
657+
629658

630659
## Contribute
631660

0 commit comments

Comments
 (0)