Vue + element website project environment construction

Vue + element-ui website project environment construction

First, build a vue environment

       ① Install vue-cli globally

   npm install -g vue-cli 

  After the installation is successful, enter vue to verify whether the installation is successful

        

    ② Create a new project, use the cd command to enter the folder where you will create the project, enter  vue init webpack demo 

   The demo here is the name of your project, followed by some initial settings, follow the instructions to select, after the selection is complete, there will be a prompt statement,

   Enter according to the sentence

cd demo
npm install
npm run dev

          

 

 

   ③ Follow the prompts, cd into the project file, run  npm install 

   ④ After running, enter  npm run dev  , if there is nothing wrong, the address of the project will appear, as follows,

   Enter the address in the browser to see the template that vue initializes

    

 Second, install Element-ui

   ① cd into the current project, run  npm i element-ui -S  (you can also enter the statement in the webstrom terminal)

   ps: after installation, element-ui can be found in node_modules

   ②After installing element-ui, it will be referenced in the project. Open the project, find main.js in the src directory, and add the reference.

  

     Finally: After setting up the vue + element-ui environment, write something to test,  

       

    The effect is as follows, so you can, you can start to develop your own project

        

 

Guess you like

Origin www.cnblogs.com/xyann/p/12721442.html