Now the front end of the mainstream has three framework, vue, angular, react, vue is the people Daniel created, locate the beginning of dependent libraries, but the development is now a mature front-end framework, so we need to look at this vue. How does that create a vue project, we started from the download node.js.
-
node Kan网: https: //nodejs.org/en/;
-
Install node.js, Note: Before installing Node.js, first cmd (command prompt) to run node -v to see whether there is Node.js version, and if so, uninstall or delete;
-
npm install, whether npm npm -v view the installation;
Open cmd, installation, input commands:
Elevation install g cnpm --registry = https: //registry.npm.taobao.org;
-
vue-cli installation, command line npm install -g vue-cli;
Of this, the global environment has been completed structures, often use the following:
-
Create a project
Create a folder (total project), such as: vuework folder in the folder column address input cmd enter this folder;
Create a project, the command: vue init webpack my-vue (my-vue project folder name), has been enter, routing plug-in installed, the other was no, need es6 grammar checker can install it yourself;
-
Access project
The address bar to enter the project folder cmd, enter the execution:
Run the command: npm run dev; -
When people visit the project, install rely npm install
-
Upload server, modify config-> index.js-> assetsPublicPath: '/', to assetsPublicPath: './';
Run the command: npm run build;