Vue
Vue前端开发
vue组件
- 即.vue文件
- 分为style,template,script三种结构,template只能有一个根元素
- 文本插值,即{
- 属性绑定,为标签属性绑定data方法中的返回值,即v-bind:xxx,简写为:xxx
- 事件绑定,为元素绑定methods数组对应的事件,即v-on:xxx,简写为@xxx
- 双向绑定,表单输入项和data方法中的属性绑定,互相影响,即v-model
- 动态渲染,根据表达式的值动态渲染页面元素,即v-if,v-else,v-else-if
Axios
-
npm install axios,import axios from 'axios'
-
![image-20240309211210390]()
-
![image-20240309211238975]()
-
![image-20240309211919517]()
-
![image-20240309212624980]()
-
默认是get请求
vue-router
-
需要在配置脚手架项目的时候选中vue-router或npm install vue-router
-
![image-20240309230956990]()
-
标签跳转
![image-20240309231750845]()
-
编程跳转
![image-20240309231820238]()
-
访问重定向
![image-20240309232038623]()
-
注:路由路径是从前往后匹配的,只有前面的路径都无法匹配才会匹配到最后的通配符
嵌套路由
VUEX
-
作用:跨组件共享数据,实时响应
-
![image-20240309233448561]()
-
![image-20240309233503475]()
-
![image-20240309233847099]()
-
![image-20240309234430103]()
-
![image-20240309234533578]()





默认是get请求












浙公网安备 33010602011771号