Turn https://www.cnblogs.com/tu-0718/p/7521099.html
Turn https://www.jianshu.com/p/1626b8643676
$ Vue init webpack exprice --------------------- This is the command to install scaffolding vue
This will install Vue 2.x version of the template. ---- ----------------- described here will create a vue 2.x version of the project
the for Vue 1.x use: the init VUE WebPACK # 1.0 exprice
? project name (exprice) - ------------------- project name
? project exprice name
? project the Description (A Vue.js project) --------------- ------ project description
? A Vue.js the description project project
? Author Datura --------------------- project creator
? Author Datura
? Vue Build ( arrow Keys the Use)
? Vue Build Standalone
? the install VUE-Router? (the Y-/ the n-) --------------------- whether to install Vue route, that is, after a spa (page application module but needed)
? the Install VUE-Router? Yes
? Use ESLint to lint your code? (Y / n) n --------------------- whether eslint detection rules enabled, where individuals proposed election NO
? ESLint to the Use lint your code? No
? Setup Unit Tests with Karma + Mocha? (the Y-/ the n-)
? Setup Unit Tests with Karma + Mocha? Yes
? Setup E2E Tests with Nightwatch? (the Y-/ the n-)
? Setup E2E Tests with Nightwatch? Yes
VUE · Generated the -cli "exprice."
the To GET started: --------------------- here's how to start this service
cd exprice
npm install
npm RUN dev
below:
- cd into the directory created by the project, first cd exprice (this is the name of his own construction);
- Installation project dependencies: npm install, because the automatic build process package.json file already exists, it is installed directly dependent on the line here. Do not mirrored cnpm from the domestic installation (it can lead to lack behind many dependent libraries), but if it is installed but "the one" hour but did not succeed then use: cnpm install it
- Installation vue routing module vue-router and network requests module vue-resource, enter: cnpm install vue-router vue-resource --save.
Created the "exprice" Contents are as follows:
Now I simply explained under each directory are doing it:
-
Startup Items, enter: npm run dev. After the service starts successfully browser will default to open a "welcome page", as shown below:
Note: This is the default service startup is local port 8080, so make sure your 8080 port is not occupied by another program.
Thus a simple project to build a complete back .... I will continue to take advantage of this construction project to write a simple one-page application.
See here for everyone to recommend a ide with Atom and install plug-ins can vue, very easy to use
Author: datura_lj
link: https: //www.jianshu.com/p/1626b8643676
Source: Jane book
Jane book copyright reserved by the authors, are reproduced in any form, please contact the author to obtain authorization and indicate the source.