Stupid question, I just start learning Vue.js and I've seen two ways of people using it and I'm a bit confuse and was wondering if someone can explain it to me. Is it that example one is used when creating individual web pages and the second is used when creating SPA application using the Vue CLI which is a more component base?
Example one:
var vm = new Vue({
el: '#example',
data: {
message: 'Hello'
}
})
Example two:
<script>
export default {
name: 'Chat',
data() {
return {
}
},
methods: {
}
}
</script>