vue-cli脚手架创建一个项目:
//npm install vue
npm install vue-cli
vue create todo-vue
vue api使用:https://cn.vuejs.org/v2/api/#v-on
vue ui使用:http://element-cn.eleme.io/2.0/#/zh-CN/component/installation
vue router:https://router.vuejs.org/guide/essentials/nested-routes.html
vuex:https://vuex.vuejs.org/guide/
vue ajax请求:vue-resource https://github.com/pagekit/vue-resource/blob/HEAD/docs/http.md
vue proxy代理设置:https://cli.vuejs.org/zh/config/#devserver-proxy
1,添加vue.config.js文件
2,设置:
module.exports={
devServer:{
"proxy": {
'/api': {
target: 'http://localhost:3000',//跳转服务端
ws: true,
changeOrigin: true
}
}
}
}
服务端可以用express框架
Todo项目实例:https://github.com/chocolateonly/vue-projects/tree/master/first-vue-project