|
6 | 6 |
|
7 | 7 | 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)**
|
8 | 8 |
|
9 |
| -### **Current version:** 2.3.7 (Supports Vue 2.2+) |
| 9 | +### **Current version:** 2.3.8 (Supports Vue 2.2+) |
10 | 10 |
|
11 | 11 | ### **For Vue 2.1.10 and below use version [2.1.3](https://github.com/jbaysolutions/vue-grid-layout/tree/2.1.3)**
|
12 | 12 | ### **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
|
175 | 175 |
|
176 | 176 | 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.
|
177 | 177 |
|
| 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 | + |
178 | 188 | * **colNum**
|
179 | 189 |
|
180 | 190 | * type: `Number`
|
@@ -469,6 +479,7 @@ Working example [here](https://jbaysolutions.github.io/vue-grid-layout/examples/
|
469 | 479 | @layout-mounted="layoutMountedEvent"
|
470 | 480 | @layout-ready="layoutReadyEvent"
|
471 | 481 | @layout-updated="layoutUpdatedEvent"
|
| 482 | + @breakpoint-changed="breakpointChangedEvent" |
472 | 483 | >
|
473 | 484 |
|
474 | 485 | <grid-item v-for="item in layout"
|
@@ -626,6 +637,24 @@ Working example [here](https://jbaysolutions.github.io/vue-grid-layout/examples/
|
626 | 637 | },
|
627 | 638 | ```
|
628 | 639 |
|
| 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 | + |
629 | 658 |
|
630 | 659 | ## Contribute
|
631 | 660 |
|
|
0 commit comments