index.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Vue.js SVG example</title>
  6. <link rel="stylesheet" href="style.css">
  7. <script src="../../dist/vue.js"></script>
  8. </head>
  9. <body>
  10. <!-- template for the polygraph component. -->
  11. <script type="text/x-template" id="polygraph-template">
  12. <g>
  13. <polygon v-attr="points:points"></polygon>
  14. <circle cx="100" cy="100" r="80"></circle>
  15. <axis-label v-repeat="stats"></axis-label>
  16. </g>
  17. </script>
  18. <!-- template for the axis label component. -->
  19. <script type="text/x-template" id="axis-label-template">
  20. <text v-attr="x:point.x, y:point.y">{{label}}</text>
  21. </script>
  22. <!-- demo root element -->
  23. <div id="demo">
  24. <!-- Use the component -->
  25. <svg width="200" height="200">
  26. <polygraph stats="{{stats}}"></polygraph>
  27. </svg>
  28. <!-- controls -->
  29. <div v-repeat="stats">
  30. <label>{{label}}</label>
  31. <input type="range" v-model="value" min="0" max="100">
  32. <span>{{value}}</span>
  33. <button v-on="click:remove(this)">X</button>
  34. </div>
  35. <form id="add">
  36. <input name="newlabel" v-model="newLabel">
  37. <button v-on="click:add">Add a Stat</button>
  38. </form>
  39. <pre id="raw">{{stats | json}}</pre>
  40. </div>
  41. <p style="font-size:12px">* input[type="range"] requires IE10 or above.</p>
  42. <script src="svg.js"></script>
  43. </body>
  44. </html>