vue2/examples/classic/svg/index.html

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
1.6 KiB
HTML
Raw Permalink Normal View History

2016-04-16 04:20:35 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Vue.js SVG graph example</title>
2016-04-16 04:20:35 +08:00
<link rel="stylesheet" href="style.css">
<!-- Delete ".min" for console warnings in development -->
2022-05-20 18:21:53 +08:00
<script src="../../../dist/vue.min.js"></script>
2016-04-16 04:20:35 +08:00
</head>
<body>
<!-- template for the polygraph component. -->
<script type="text/x-template" id="polygraph-template">
<g>
<polygon :points="points"></polygon>
<circle cx="100" cy="100" r="80"></circle>
<axis-label
v-for="(stat, index) in stats"
2016-04-16 04:20:35 +08:00
:stat="stat"
:index="index"
2016-04-16 04:20:35 +08:00
:total="stats.length">
</axis-label>
</g>
</script>
<!-- template for the axis label component. -->
<script type="text/x-template" id="axis-label-template">
<text :x="point.x" :y="point.y">{{stat.label}}</text>
</script>
<!-- demo root element -->
<div id="demo">
<!-- Use the component -->
<svg width="200" height="200">
<polygraph :stats="stats"></polygraph>
</svg>
<!-- controls -->
<div v-for="stat in stats">
<label>{{stat.label}}</label>
<input type="range" v-model="stat.value" min="0" max="100">
<span>{{stat.value}}</span>
2016-04-16 15:07:08 +08:00
<button @click="remove(stat)" class="remove">X</button>
2016-04-16 04:20:35 +08:00
</div>
<form id="add">
<input name="newlabel" v-model="newLabel">
<button @click="add">Add a Stat</button>
</form>
2016-04-30 07:40:53 +08:00
<pre id="raw">{{ stats }}</pre>
2016-04-16 04:20:35 +08:00
</div>
<p style="font-size:12px">* input[type="range"] requires IE10 or above.</p>
<script src="svg.js"></script>
</body>
</html>