[mod] component
This commit is contained in:
parent
57ba0a5938
commit
4bea950bbe
2 changed files with 13 additions and 0 deletions
|
@ -5,6 +5,9 @@
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<script type="text/html" id="cmp-link">
|
||||||
|
<div>{{ hello }}</div>
|
||||||
|
</script>
|
||||||
This is a test
|
This is a test
|
||||||
<div>Page loaded at: {{now | date "Mon Jan 2 15:04:05 MST 2006"}}</div>
|
<div>Page loaded at: {{now | date "Mon Jan 2 15:04:05 MST 2006"}}</div>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
|
@ -12,6 +15,7 @@
|
||||||
<div> {{ message }}</div>
|
<div> {{ message }}</div>
|
||||||
<pre>{{ json }}</pre>
|
<pre>{{ json }}</pre>
|
||||||
</div>
|
</div>
|
||||||
|
<my-link>foo</my-link>
|
||||||
|
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -56,3 +56,12 @@ var app = new Vue({
|
||||||
this.load()
|
this.load()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//Define a new global component called button-counter
|
||||||
|
app.component('my-link', {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
count: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
template: '#cmp-link'
|
||||||
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue