mirror of https://github.com/vuejs/vue.git
update svg example
This commit is contained in:
parent
7df70e7963
commit
611486c036
|
|
@ -10,19 +10,19 @@
|
||||||
|
|
||||||
<!-- template for the polygraph component. -->
|
<!-- template for the polygraph component. -->
|
||||||
<script type="text/x-template" id="polygraph-template">
|
<script type="text/x-template" id="polygraph-template">
|
||||||
<svg width="200" height="200">
|
<polygon v-attr="points:points"></polygon>
|
||||||
<polygon v-attr="points: points"></polygon>
|
<circle cx="100" cy="100" r="80"></circle>
|
||||||
<circle cx="100" cy="100" r="80"></circle>
|
<text v-repeat="stats" v-component="axis-label" v-attr="x:x, y:y">
|
||||||
<text v-component="axis-label" v-repeat="stats" v-attr="x:x, y:y">
|
{{label}}
|
||||||
{{label}}
|
</text>
|
||||||
</text>
|
|
||||||
</svg>
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- demo root element -->
|
<!-- demo root element -->
|
||||||
<div id="demo">
|
<div id="demo">
|
||||||
<!-- Use the component -->
|
<!-- Use the component -->
|
||||||
<svg v-component="polygraph" v-with="stats:stats"></svg>
|
<svg width="200" height="200">
|
||||||
|
<g v-component="polygraph" v-with="stats:stats"></g>
|
||||||
|
</svg>
|
||||||
<!-- controls -->
|
<!-- controls -->
|
||||||
<div v-repeat="stats">
|
<div v-repeat="stats">
|
||||||
<label>{{label}}</label>
|
<label>{{label}}</label>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ var stats = [
|
||||||
// A resusable polygon graph component
|
// A resusable polygon graph component
|
||||||
Vue.component('polygraph', {
|
Vue.component('polygraph', {
|
||||||
template: '#polygraph-template',
|
template: '#polygraph-template',
|
||||||
replace: true,
|
|
||||||
computed: {
|
computed: {
|
||||||
// a computed property for the polygon's points
|
// a computed property for the polygon's points
|
||||||
points: function () {
|
points: function () {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue