|
| 1 | +var testLayout = [ |
| 2 | + {"x":0,"y":0,"w":2,"h":5,"i":"0", static: false}, |
| 3 | + {"x":2,"y":0,"w":2,"h":2,"i":"1", static: false}, |
| 4 | + {"x":4,"y":0,"w":2,"h":5,"i":"2", static: false}, |
| 5 | + {"x":6,"y":0,"w":2,"h":3,"i":"3", static: false}, |
| 6 | + {"x":8,"y":0,"w":2,"h":3,"i":"4", static: false}, |
| 7 | + {"x":10,"y":0,"w":2,"h":3,"i":"5", static: false}, |
| 8 | + {"x":0,"y":5,"w":2,"h":5,"i":"6", static: false}, |
| 9 | + {"x":2,"y":5,"w":2,"h":5,"i":"7", static: false}, |
| 10 | + {"x":4,"y":5,"w":2,"h":5,"i":"8", static: false}, |
| 11 | + {"x":6,"y":3,"w":2,"h":4,"i":"9", static: false}, |
| 12 | + {"x":8,"y":4,"w":2,"h":4,"i":"10", static: false}, |
| 13 | + {"x":10,"y":4,"w":2,"h":4,"i":"11", static: false}, |
| 14 | + {"x":0,"y":10,"w":2,"h":5,"i":"12", static: false}, |
| 15 | + {"x":2,"y":10,"w":2,"h":5,"i":"13", static: false}, |
| 16 | + {"x":4,"y":8,"w":2,"h":4,"i":"14", static: false}, |
| 17 | + {"x":6,"y":8,"w":2,"h":4,"i":"15", static: false}, |
| 18 | + {"x":8,"y":10,"w":2,"h":5,"i":"16", static: false}, |
| 19 | + {"x":10,"y":4,"w":2,"h":2,"i":"17", static: false}, |
| 20 | + {"x":0,"y":9,"w":2,"h":3,"i":"18", static: false}, |
| 21 | + {"x":2,"y":6,"w":2,"h":2,"i":"19", static: false} |
| 22 | +]; |
| 23 | + |
| 24 | +// var GridLayout = VueGridLayout.GridLayout; |
| 25 | +// var GridItem = VueGridLayout.GridItem; |
| 26 | + |
| 27 | +new Vue({ |
| 28 | + el: '#app', |
| 29 | + // components: { |
| 30 | + // "GridLayout": GridLayout, |
| 31 | + // "GridItem": GridItem |
| 32 | + // }, |
| 33 | + data: { |
| 34 | + layout: testLayout, |
| 35 | + draggable: true, |
| 36 | + resizable: true, |
| 37 | + index: 0 |
| 38 | + }, |
| 39 | + |
| 40 | +/* |
| 41 | + mounted: function () { |
| 42 | + this.index = this.layout.length; |
| 43 | + }, |
| 44 | + */ |
| 45 | + methods: { |
| 46 | + itemTitle(item) { |
| 47 | + var result = item.i; |
| 48 | + if (item.static) { |
| 49 | + result += " - Static"; |
| 50 | + } |
| 51 | + return result; |
| 52 | + } |
| 53 | + } |
| 54 | +}); |
| 55 | + |
| 56 | + |
0 commit comments