01-basic.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Vue Grid Layout Example 1 - Basic</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 1 - Basic</h1>
  12. <a href="https://github.com/jbaysolutions/vue-grid-layout">View project on Github</a>
  13. <br/>
  14. <a href="02-events.html">Next example: Move and resize events</a>
  15. <div id="app" style="width: 100%;">
  16. <!--<pre>{{ $data | json }}</pre>-->
  17. <div>
  18. <div class="layoutJSON">
  19. Displayed as <code>[x, y, w, h]</code>:
  20. <div class="columns">
  21. <div class="layoutItem" v-for="item in layout">
  22. <b>{{item.i}}</b>: [{{item.x}}, {{item.y}}, {{item.w}}, {{item.h}}]
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. <div id="content">
  28. <!--<button @click="decreaseWidth">Decrease Width</button>
  29. <button @click="increaseWidth">Increase Width</button>
  30. <button @click="addItem">Add an item</button>-->
  31. <input type="checkbox" v-model="draggable"/> Draggable
  32. <input type="checkbox" v-model="resizable"/> Resizable
  33. <br/>
  34. <grid-layout :layout="layout"
  35. :col-num="12"
  36. :row-height="30"
  37. :is-draggable="draggable"
  38. :is-resizable="resizable"
  39. :vertical-compact="true"
  40. :use-css-transforms="true"
  41. >
  42. <grid-item v-for="item in layout"
  43. :static="item.static"
  44. :x="item.x"
  45. :y="item.y"
  46. :w="item.w"
  47. :h="item.h"
  48. :i="item.i"
  49. >
  50. <span class="text">{{itemTitle(item)}}</span>
  51. </grid-item>
  52. </grid-layout>
  53. </div>
  54. </div>
  55. <script src="vue.min.js"></script>
  56. <script src="../dist/vue-grid-layout.umd.min.js"></script>
  57. <script src="01-basic.js"></script>
  58. </body>
  59. </html>