Created
May 29, 2020 07:33
-
-
Save TheBojda/7c4ae3214c1a6e50a323071681c7a2b7 to your computer and use it in GitHub Desktop.
Simple Vue.js example
This file contains 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/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