Why is it that I can't get a basic hello world to print using Vue when I put it in an external js file, yet when I put it in the html file surrounded by a script tag, it works fine
When I copy and paste the contents of the that script tag inside a file called js_vue.js it doesn't work at all
I'm new to learning Vue so I don't tell get what's going on here. Surely there's a way to put all my js code in a separate file like I would with raw html and jquery
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://unpkg.com/vue"></script>
<script src="js_vue.js"></script>
</head>
<body>
<div id="app">
{{ message }}
</div>
</body>
</html>
<script>
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})
</script>
As a Snippet:
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})
<script src="https://unpkg.com/vue"></script>
<div id="app">
{{ message }}
</div>