Using Vue in your web application
There are several options to use Vue in your web application, and it largely depends on what your objective is:
- To include a small self-contained application or piece of code on a page, you can directly import Vue and code inside a script tag
- To build a larger application, you will need a build tool that takes your code and bundles it for distribution
Notice that I use the word bundle and not compile, as JavaScript applications are interpreted and executed at runtime on the browser. This will become apparent later on when we introduce the concept of single-file components.
Let’s briefly see an example of the first case in a very simple HTML page:
<html> <head> <script src="https://unpkg.com/vue@3"></script> </head> <body> <div id="app"> {{message}} </div>...