We will create a new file and we will drop some boilerplate code in. You can name it anything you like, this one is called hello.html
:
<html> <head> <title>Hello Vue</title> </head> <body> <h1>Greetings your Majesty!</h1> </body> </html>
This is a simple HTML file with a greeting message.
Now we will carry on and do the same job using Vue.js. First of all, we will include Vue.js and create a new instance:
<html> <head> <title>Hello Vue</title> </head> <body> <div id="app"> <h1>Greetings your majesty!</h1> </div> </body> <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.min.js"> </script> <script> new Vue({ el: '#app', }) </script> ...