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. -->
|
||||
<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>
|
||||
<text v-component="axis-label" v-repeat="stats" v-attr="x:x, y:y">
|
||||
<text v-repeat="stats" v-component="axis-label" v-attr="x:x, y:y">
|
||||
{{label}}
|
||||
</text>
|
||||
</svg>
|
||||
</script>
|
||||
|
||||
<!-- demo root element -->
|
||||
<div id="demo">
|
||||
<!-- 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 -->
|
||||
<div v-repeat="stats">
|
||||
<label>{{label}}</label>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ var stats = [
|
|||
// A resusable polygon graph component
|
||||
Vue.component('polygraph', {
|
||||
template: '#polygraph-template',
|
||||
replace: true,
|
||||
computed: {
|
||||
// a computed property for the polygon's points
|
||||
points: function () {
|
||||
|
|
|
|||
Loading…
Reference in New Issue