08-responsive-predefined-layouts.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. var testLayouts = {
  2. md: [
  3. {"x":0, "y":0, "w":2, "h":2, "i":"0"},
  4. {"x":2, "y":0, "w":2, "h":4, "i":"1"},
  5. {"x":4, "y":0, "w":2, "h":5, "i":"2"},
  6. {"x":6, "y":0, "w":2, "h":3, "i":"3"},
  7. {"x":2, "y":4, "w":2, "h":3, "i":"4"},
  8. {"x":4, "y":5, "w":2, "h":3, "i":"5"},
  9. {"x":0, "y":2, "w":2, "h":5, "i":"6"},
  10. {"x":2, "y":7, "w":2, "h":5, "i":"7"},
  11. {"x":4, "y":8, "w":2, "h":5, "i":"8"},
  12. {"x":6, "y":3, "w":2, "h":4, "i":"9"},
  13. {"x":0, "y":7, "w":2, "h":4, "i":"10"},
  14. {"x":2, "y":19, "w":2, "h":4, "i":"11"},
  15. {"x":0, "y":14, "w":2, "h":5, "i":"12"},
  16. {"x":2, "y":14, "w":2, "h":5, "i":"13"},
  17. {"x":4, "y":13, "w":2, "h":4, "i":"14"},
  18. {"x":6, "y":7, "w":2, "h":4, "i":"15"},
  19. {"x":0, "y":19, "w":2, "h":5, "i":"16"},
  20. {"x":8, "y":0, "w":2, "h":2, "i":"17"},
  21. {"x":0, "y":11, "w":2, "h":3, "i":"18"},
  22. {"x":2, "y":12, "w":2, "h":2, "i":"19"}
  23. ],
  24. lg: [
  25. {"x":0,"y":0,"w":2,"h":2,"i":"0"},
  26. {"x":2,"y":0,"w":2,"h":4,"i":"1"},
  27. {"x":4,"y":0,"w":2,"h":5,"i":"2"},
  28. {"x":6,"y":0,"w":2,"h":3,"i":"3"},
  29. {"x":8,"y":0,"w":2,"h":3,"i":"4"},
  30. {"x":10,"y":0,"w":2,"h":3,"i":"5"},
  31. {"x":0,"y":5,"w":2,"h":5,"i":"6"},
  32. {"x":2,"y":5,"w":2,"h":5,"i":"7"},
  33. {"x":4,"y":5,"w":2,"h":5,"i":"8"},
  34. {"x":6,"y":4,"w":2,"h":4,"i":"9"},
  35. {"x":8,"y":4,"w":2,"h":4,"i":"10"},
  36. {"x":10,"y":4,"w":2,"h":4,"i":"11"},
  37. {"x":0,"y":10,"w":2,"h":5,"i":"12"},
  38. {"x":2,"y":10,"w":2,"h":5,"i":"13"},
  39. {"x":4,"y":8,"w":2,"h":4,"i":"14"},
  40. {"x":6,"y":8,"w":2,"h":4,"i":"15"},
  41. {"x":8,"y":10,"w":2,"h":5,"i":"16"},
  42. {"x":10,"y":4,"w":2,"h":2,"i":"17"},
  43. {"x":0,"y":9,"w":2,"h":3,"i":"18"},
  44. {"x":2,"y":6,"w":2,"h":2,"i":"19"}
  45. ],
  46. };
  47. // var GridLayout = VueGridLayout.GridLayout;
  48. // var GridItem = VueGridLayout.GridItem;
  49. new Vue({
  50. el: '#app',
  51. // components: {
  52. // "GridLayout": GridLayout,
  53. // "GridItem": GridItem
  54. // },
  55. data: {
  56. layouts: testLayouts,
  57. layout: testLayouts["lg"],
  58. draggable: true,
  59. resizable: true,
  60. responsive: true,
  61. index: 0
  62. },
  63. mounted: function () {
  64. // this.index = this.layout.length;
  65. },
  66. methods: {
  67. breakpointChangedEvent: function(newBreakpoint, newLayout){
  68. console.log("BREAKPOINT CHANGED breakpoint=", newBreakpoint, ", layout: ", newLayout );
  69. }
  70. }
  71. });