Starting my journey with VueJs using single file application has been quite interesting.
Initially, I had everything in a single html
page with both javascript
and CSS
styles embedded within it.
To avoid fetching VueJs features online, I downloaded the Vue.JS
file and linked it directly in the HTML
file by including:
<head>
...
<script src="vue.js"
...
</head>
This simple step allowed me to incorporate a <script>...</script>
tag in my HTML
file, enabling recognition of Vue
.
It worked seamlessly.
Now, I wish to organize the code into separate files:
HTML
fileJS
fileCSS
file
However, I am now faced with a dilemma on what to include in the <head>
section of my HTML file. I need to import my file.js
with my code, while also running my local Vue.js
file instead of relying on the web version.
How should I proceed?
I attempted the following approach, which unfortunately did not work:
<head>
<title>First Vue playground</title>
<link rel="stylesheet" href="style.css">
<!-- Below is my JS code-->
<script src="appJS.js"></script>
<!-- below is my vue.js file so it runs Vue locally instead of importing it-->
<scrip src="vue.js"></scrip>
</head>
As a beginner in this realm, any assistance would be greatly appreciated.
Thank you all in advance.