|
2 | 2 | <div id="app">
|
3 | 3 | <h1 style="text-align: center">Vue Grid Layout</h1>
|
4 | 4 | <!--<pre>{{ layout | json }}</pre>-->
|
| 5 | +<!-- <interact-tester></interact-tester>--> |
5 | 6 | <div>
|
6 | 7 | <div class="layoutJSON">
|
7 | 8 | Displayed as <code>[x, y, w, h]</code>:
|
|
40 | 41 | :margin="[parseInt(marginX), parseInt(marginY)]"
|
41 | 42 | :layout.sync="layout"
|
42 | 43 | :col-num="parseInt(colNum)"
|
43 |
| - :row-height="rowHeight" |
| 44 | + :row-height="parseInt(rowHeight)" |
44 | 45 | :is-draggable="draggable"
|
45 | 46 | :is-resizable="resizable"
|
46 | 47 | :is-mirrored="mirrored"
|
47 | 48 | :prevent-collision="preventCollision"
|
48 | 49 | :vertical-compact="compact"
|
49 |
| - :use-css-transforms="true" |
| 50 | + :use-css-transforms="false" |
50 | 51 | :responsive="responsive"
|
51 |
| - @layout-created="layoutCreatedEvent" |
52 |
| - @layout-before-mount="layoutBeforeMountEvent" |
53 |
| - @layout-mounted="layoutMountedEvent" |
54 |
| - @layout-ready="layoutReadyEvent" |
55 |
| - @layout-updated="layoutUpdatedEvent" |
56 |
| - @breakpoint-changed="breakpointChangedEvent" |
57 | 52 | >
|
58 | 53 | <grid-item v-for="item in layout" :key="item.i"
|
59 | 54 | :static="item.static"
|
|
64 | 59 | :i="item.i"
|
65 | 60 | :min-w="item.minW"
|
66 | 61 | :max-w="item.maxW"
|
| 62 | + :min-h="item.minH" |
| 63 | + :max-h="item.maxH" |
67 | 64 | :min-x="item.minX"
|
68 | 65 | :max-x="item.maxX"
|
69 | 66 | :min-y="item.minY"
|
70 | 67 | :max-y="item.maxY"
|
| 68 | + :resize-from="['left', 'right', 'top', 'bottom']" |
71 | 69 | :preserve-aspect-ratio="item.preserveAspectRatio"
|
72 |
| - @resize="resize" |
73 |
| - @move="move" |
74 |
| - @resized="resized" |
75 |
| - @container-resized="containerResized" |
76 |
| - @moved="moved" |
77 | 70 | >
|
78 | 71 | <!--<custom-drag-element :text="item.i"></custom-drag-element>-->
|
79 | 72 | <test-element :text="item.i" @removeItem="removeItem($event)"></test-element>
|
|
113 | 106 | import GridLayout from './components/GridLayout.vue';
|
114 | 107 | // import ResponsiveGridLayout from './components/ResponsiveGridLayout.vue';
|
115 | 108 | import TestElement from './components/TestElement.vue';
|
116 |
| - import CustomDragElement from './components/CustomDragElement.vue'; |
| 109 | + // import CustomDragElement from './components/CustomDragElement.vue'; |
117 | 110 | import {getDocumentDir, setDocumentDir} from "./helpers/DOM";
|
| 111 | + import InteractTester from "@/components/InteractTester"; |
118 | 112 | //var eventBus = require('./eventBus');
|
119 | 113 |
|
120 |
| - let testLayout = [ |
121 |
| - {"x":0,"y":0,"w":2,"h":2,"i":"0", resizable: true, draggable: true, static: false, minY: 0, maxY: 2}, |
| 114 | + /*let testLayout = [ |
| 115 | + {"x":0,"y":0,"w":2,"h":2,"i":"0", resizable: true, draggable: true, static: false, minY: 0, maxY: 2, minW: 2, maxW: 4, minH: 2, maxH: 4}, |
122 | 116 | {"x":2,"y":0,"w":2,"h":4,"i":"1", resizable: null, draggable: null, static: true},
|
123 |
| - {"x":4,"y":0,"w":2,"h":5,"i":"2", resizable: false, draggable: false, static: false, minX: 4, maxX: 4, minW: 2, maxW: 2, preserveAspectRatio: true}, |
| 117 | + {"x":4,"y":0,"w":2,"h":5,"i":"2", resizable: false, draggable: false, static: false, minX: 4, maxX: 4, minW: 2, maxW: 4, preserveAspectRatio: true}, |
124 | 118 | {"x":6,"y":0,"w":2,"h":3,"i":"3", resizable: false, draggable: false, static: false},
|
125 | 119 | {"x":8,"y":0,"w":2,"h":3,"i":"4", resizable: false, draggable: false, static: false},
|
126 | 120 | {"x":10,"y":0,"w":2,"h":3,"i":"5", resizable: false, draggable: false, static: false},
|
|
138 | 132 | {"x":10,"y":4,"w":2,"h":2,"i":"17", resizable: false, draggable: false, static: false},
|
139 | 133 | {"x":0,"y":9,"w":2,"h":3,"i":"18", resizable: false, draggable: false, static: false},
|
140 | 134 | {"x":2,"y":6,"w":2,"h":2,"i":"19", resizable: false, draggable: false, static: false}
|
| 135 | + ];*/ |
| 136 | +
|
| 137 | + let testLayout = [ |
| 138 | + {"x":5,"y":0,"w":1,"h":3,"i":"0", resizable: true, draggable: true}, |
| 139 | + {"x":6,"y":0,"w":6,"h":6,"i":"1", resizable: true, draggable: true}, |
141 | 140 | ];
|
142 | 141 |
|
143 | 142 | /*let testLayout = [
|
|
151 | 150 | export default {
|
152 | 151 | name: 'app',
|
153 | 152 | components: {
|
| 153 | + InteractTester, |
154 | 154 | GridLayout,
|
155 | 155 | GridItem,
|
156 | 156 | TestElement,
|
157 |
| - CustomDragElement, |
| 157 | + // CustomDragElement, |
158 | 158 | },
|
159 | 159 | data () {
|
160 | 160 | return {
|
|
0 commit comments