What do we need for our Vue Project?
- Set up a GitHub repository
- Use GitHub Desktop to clone the repo to a file on your local drive
- Open the command terminal in the local desktop file
- Ensure Node.js is installed – https://nodejs.org/en
How do we use the Vue CLI to install the project?
Start by adding the following code:
npm init vue@latest
Give the project a name, and follow the prompts that are provided.
The following code can be used in the terminal:
cd level-tech // Change Directory npm install // Install Package npm run dev // Compile and Hot-Reload for Development npm run build // Compile and Minify for Production
How do we add the WordPress API?
We start by setting the package in the package.json file using the below code in the terminal:
npm install vue-resource --save
If this gives an error then we need to run the install command to install the resource:
We will also install the “Axios” package to assist with our API calls:
npm install axios