08-responsive-predefined-layouts.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Vue Grid Layout Example 8 - Responsive with predefined layouts</title>
  6. <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
  7. <link rel="stylesheet" href="app.css">
  8. <!--<link rel="stylesheet" href="../dist/vue-grid-layout.css">-->
  9. </head>
  10. <body>
  11. <h1>Vue Grid Layout Example 8 - Responsive with predefined layouts</h1>
  12. <a href="https://github.com/jbaysolutions/vue-grid-layout">View project on Github</a>
  13. <br />
  14. <a href="07-prevent-collision.html">Previous example: Prevent collision</a>
  15. <br />
  16. <a href="09-dynamic-add-remove.html">Next example: Dynamic Add/Remove</a>
  17. <div id="app" style="width: 100%;">
  18. <!--<pre>{{ $data | json }}</pre>-->
  19. <div>
  20. <div class="layoutJSON">
  21. Displayed as <code>[x, y, w, h]</code>:
  22. <div class="columns">
  23. <div class="layoutItem" v-for="item in layout">
  24. <b>{{item.i}}</b>: [{{item.x}}, {{item.y}}, {{item.w}}, {{item.h}}]
  25. </div>
  26. </div>
  27. </div>
  28. </div>
  29. <div id="content">
  30. <!--<button @click="decreaseWidth">Decrease Width</button>
  31. <button @click="increaseWidth">Increase Width</button>
  32. <button @click="addItem">Add an item</button>-->
  33. <input type="checkbox" v-model="draggable" /> Draggable
  34. <input type="checkbox" v-model="resizable" /> Resizable
  35. <input type="checkbox" v-model="responsive" /> Responsive
  36. <br />
  37. <grid-layout :layout.sync="layout"
  38. :responsive-layouts="layouts"
  39. :col-num="12"
  40. :row-height="30"
  41. :is-draggable="draggable"
  42. :is-resizable="resizable"
  43. :vertical-compact="true"
  44. :use-css-transforms="true"
  45. :responsive="responsive"
  46. @breakpoint-changed="breakpointChangedEvent"
  47. >
  48. <grid-item v-for="item in layout"
  49. :x="item.x"
  50. :y="item.y"
  51. :w="item.w"
  52. :h="item.h"
  53. :i="item.i"
  54. >
  55. <span class="text">{{item.i}}</span>
  56. </grid-item>
  57. </grid-layout>
  58. </div>
  59. </div>
  60. <script src="vue.min.js"></script>
  61. <script src="../dist/vue-grid-layout.umd.min.js"></script>
  62. <script src="08-responsive-predefined-layouts.js"></script>
  63. </body>
  64. </html>