vue 3.0 project to build

Installation vue-cli

npm install -g vue-cli

After installing scaffolding

cmd into the project directory

C:\Users\Administrator>E:

E: \ > Cd E: \ Vue

E: \ view > view create move-demo

 

 

 The implementation of the above error     

npm install -g @vue/cli  
Supporting information
after vue-cli of 3.0+ not using vue-cli, if installed with the above command is not installed the latest version 3.0+ , and if 3.0 is installed, then you need to use the new npm install @vue/cli -g If you have the original installation vue- cli, then you need to uninstall the original installation npm uninstall vue-cli -g

 

After installing version View vue

vue -V

 

 

 Create a project

Vue create differences with the vue init
vue create vue-cli3.x is initialized, the current template is fixed, freely configurable template option, to create out of the vue-cli3 project, 
and cue-cli2 different project structure, different configuration, the specific configuration reference web links official documents.
vue init is initialized vue-cli2.x, you can use some templates github above to initialize the project,
WebPACK is the official recommended standard template name. Copy vue-cli2.x project to migrate 3.x just need static directory to the public directory,
src directory covering old project src directory of 3.x (If you modify the configuration, you can view the document, configured with the method of cli3 )

Create a project

vue create move-deom

 

 

 

vue / cli-service seemingly installed automatically,
Do not execute the following command
When vue-cli3.0 installed the vue-cli-service installed together, namely the implementation of the npm install vue-cli-service --save-dev

Project Open

 

 

 npm run serve to run the project

But it can be modified to

 

 

  npm run dev to run the project

Use vue-cli installation project devServe set open start twice to true solutions when the browser

 

 

Install additional plug-ins

 

 

npm install vue-router --save

 

npm install vuex --save
npm i -S vuelidate

Vuelidate is a simple lightweight verification based Vue.js module plug-ins.

npm install vant --save
npm install swiper --save

 

npm install swiper --save

 

Guess you like

Origin www.cnblogs.com/dianzan/p/12367721.html