-
Create a New Folder
Start by making a new folder for your project. Open the terminal in that folder by holding theShift
key and right-clicking on the folder.
-
Set Up the Vue Environment
In the terminal, run the following command to install the Vue CLI globally:npm i -g @vue/cli-init
-
Initialize the Vue Project
Now, initialize the Vue project by running the command below:vue init webpack vue-midterm
-
Installing Dependencies
During the setup, you might be prompted to install some dependencies. TypeY
and pressEnter
to continue.
-
Navigate to the Project Folder
Once the initialization is complete, enter the project directory and install the required packages by running the following commands:cd vue-midterm npm install npm run dev
-
Open the Project in the Browser
After running these commands, the terminal should display a link. Open that link in your browser by holding theCtrl
key and clicking on it.
-
Check the Vue Setup
If everything is working correctly, you should see the following screen in your browser:
-
Creating a Nav Bar
This can be done by editing theApp.vue
file in thesrc
folder and theindex.js
file in therouter
folder.With this, you should be able to see the navigation bar on the browser and have it navigate to the different pages when it is pressed.
-
Turning on Your RapidAPI Key and Making Sure It Is Working
Visit the RapidAPI website and turn on the key you want to use. In our use case, we used the WeatherAPI.com API key.Make sure you log in (you will have to sign up if you don't have an account) and turn on the key. You can then use the key in your project.
If this is not done, your API key will not work. This is very important. Make sure it is done.
-
Creating a Weather Component
This was done by editing theFormView.vue
file in theviews
folder and theWeather.vue
file in thecomponents
folder.Depending on the requirements, all you have to do is edit that file; there is no reason to touch any other file.
USE ChatGPT if you need help or get stuck.