Created
December 10, 2018 09:02
-
-
Save shailen-naidoo/5d30c61740def58c4ba51cb17741a3c6 to your computer and use it in GitHub Desktop.
Vue component using Vue.component()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script> | |
</head> | |
<body> | |
<div id="app"> | |
<my-button-counter></my-button-counter> | |
</div> | |
</body> | |
<script> | |
Vue.component("my-button-counter",{ | |
template` | |
<button v-on:click="count++"> | |
counter | |
</button> | |
`, | |
data() { | |
return { | |
count: 0 | |
} | |
} | |
}) | |
</script> | |
<script> | |
new Vue({ el: "#app" }); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment