npm install vue // install VUE
npm install -g @ vue / cli // install VUE cli
vue -version // to return the goods is to look at what it vue cli version number is not returned is not installed
For example, use the cd command to enter into the // c drive is c: Enter
Npm ls packet inspection module name or a specific package which installed the version number
Adding a node global environment variables meal mouse
Vue create the project name to create a project vue
View CLI v3.5.1
? Please pick a preset: (Use arrow keys)
> default (babel, eslint)
Manually select features
Option is to use the default configuration or configure their own
The first is the default configuration and the second is his own master must configure their own ah
The first is a translation tool can convert the code is another principle es6 es5 AST
The second is the TS of an interpreter you can write TS
The third is to support you might not have access pwa
The fourth route must use
The fifth vuex the global state machine something very Cock follow-up must learn
The sixth css pre interpreter such as less scss Han
Seventh code verification tool is to see your grammar to write something on the wrong Do not choose this cargo will make your code does not compile because your past is certainly not standard
An eighth module unit tests
Finally, a test module e2e
Well, the most basic first-come,
All the way to the next step
Startup Items folder into the npm run serve
To stop the service ctrl + c
Src is where you write the code
Vue build package
Package command
npm run build
element is not there you look inside a folder dist
You enter on the command line dist
This is to say that you did not install http-server
npm install http-server -g
Then run inside dist http service is launched
npm install mockjs
你先装一下mock
装完之后在 main.js
里面引用一下
然后项目引入 axios
npm install axios
然后对应这个地址 创建这么个文件
/mock/index.js
index.js
这么写
import Mock from 'mockjs'
export default {
mockData () {
Mock.mock('你访问的接口', {
接口返回的数据
}
})