Setting up the Vue project with the Vue CLI and script tag
There are several ways to create Vue projects or to add script tags to our existing frontends. For prototyping or learning purposes, we can add the latest version of Vue 3 by adding the following code:
<script src="https://unpkg.com/vue@next"></script>
This will always include the latest version of Vue in our app. If we use it in production, we should include the version number to avoid unexpected changes from newer versions breaking our app. The version number can replace the next
word if we want to specify the version.
We can also install Vue by installing it as a package. To do that, we can run the following command:
npm install vue@next
This will install the latest version of Vue in our JavaScript project.
If we created a Vue project from scratch with an older version of the Vue CLI, then we can use the CLI to generate all the files and install all the packages for us. This is the...