Wednesday 5 December 2018

vue component - How to use Vue.js in an external js file

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








Title








{{ message }}











As a Snippet:





var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})





{{ message }}


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...