“** This is the 7th day of my participation in the August Gwen Challenge.

directory

Step 1: Install NPM environment first, some friends directly skip –>

Step 2: Create the project

Step 3: Modify the configuration file


Step 1: Install NPM environment first, some friends directly skip –>


Install the NPM

First, download nodejs from nodejs.org

Double-click Install and press Next on the installation screen

Until Finish completes the installation.

Open the control command line program (CMD), enter the command to check whether it is normal

To use the domestic image CNPM, enter the following command

npm  install  -g  cnpm  –registry=registry.npm.taobao.org


Step 2: Create the project

Step 1: Install VUE-CLI

CNPM install vue-cli -g // Global install vue-cli

Check whether vue-CLI is successful. You need to check vue instead of vue-CLI

Select a path and create a new VUE project. To build the project in that directory, CD to the directory path

The following project is called Mountains New VUE Project

Vue init webpack

CD to the project directory and run the NPM install or CNPM install command to install the dependency packages

Start the command: NPM run dev or CNPM run dev

Then open your browser and access the address: 127.0.0.1:8080


Step 3: Modify the configuration file

I use vscode to open the project I just created

File > Open Folder > select the created project and import it

So let’s go ahead and import the project and find out where the default page was loaded

Find the index.js file under the Router file, which is the configuration file for the service routing

Find the route follow the incoming address to find the actual VUE page that just loaded

Create a new page login.vue

Make the default address point to our login.vue

Restart access

As you can see, although our login page loads, there is an image that we didn’t write, and this is the global import page of vue

Open main.js in the root directory

Find the app. vue page according to the code and open it

Annotate both, and our page is an element in itself

\