Skip to content

Instantly share code, notes, and snippets.

@TheBojda
Created May 29, 2020 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheBojda/7c4ae3214c1a6e50a323071681c7a2b7 to your computer and use it in GitHub Desktop.
Save TheBojda/7c4ae3214c1a6e50a323071681c7a2b7 to your computer and use it in GitHub Desktop.
Simple Vue.js example
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
<span>{{msg}}</span><button @click="btnClick">Push me!</button>
</div>
<script>
new Vue({
el: '#app',
data: {
msg: 'Hello World!'
},
methods: {
btnClick() {
this.msg = 'Hello Vue!';
}
}
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment