运行你的项目
npm run dev 运行指令
将项目打包至list
npm run build 打包指令打包至list
axios
install axios vue-axios --savs --save-exact
使用
import axios from ‘axios’
import VueAxios from ‘vue-axios’
Vue.use(VueAxios,axios)
#css样式
css文件放assets
在
App.vur
整个网页的入口
入口的组件:main.js
提示
webpack的elisent代码规范不要开会一直报错
组件结构
template:html
script;js(es6)
style:css
static
静态文件夹,存放静态文件(编译时,直接拷贝文件至编译文件夹)
index.html
网页启动时的入口文件,里面的id=“app”不要动
路由
路由组件vue-router
导入路由组件:
src/router/index.js
src/router/main.js
代碼規範化
alt shift F
组件使用流程
1.components里写组件
2.index绑定组件
3.app.vue使用组件
动态路由的常用方法
beforeRouteUpdate()
路由嵌套
子路由
static文件夹
存放静态页面