提交 5e834d7a 编写于 作者: Z zhaoss

2.2.1小节习题、关键字添加

上级 0e741a94
{
"type": "code_options",
"author": null,
"author": "zhaoss",
"source": "exercises.md",
"notebook_enable": false,
"exercise_id": "51b47b0ce6e0488390f51225751a2424"
......
{
"node_id": "vue-ffb7401f51a7483bb21eaa81827c0e73",
"keywords": [],
"keywords": [
"Vue路由",
"VueRoute是什么"
],
"children": [],
"export": [],
"keywords_must": [],
"export": [
"exercises.json"
],
"keywords_must": [
"Vue"
],
"keywords_forbid": []
}
\ No newline at end of file
{
"type": "code_options",
"author": null,
"source": "exercises.md",
"notebook_enable": false,
"exercise_id": "ae1fe8c628e74e8790d3a216d7d78fe0"
}
\ No newline at end of file
# vue-router是什么?
<div style="color: pink;">小常识:</div>
<br>
**概念**
路由的本质就是一种对应关系,比如说我们在url地址中输入我们要访问的url地址之后,浏览器要去请求这个url地址对应的资源。
那么url地址和真实的资源之间就有一种对应的关系,就是路由。
**路由分为前端路由和后端路由**
1).后端路由是由服务器端进行实现,并完成资源的分发
后端路由性能相对前端路由来说较低,所以,我们接下来主要学习的是前端路由
2).前端路由是依靠hash值(锚链接)的变化进行实现
前端路由的基本概念:根据不同的事件来显示不同的页面内容,即事件与事件处理函数之间的对应关系
前端路由主要做的事情就是监听事件并分发执行事件处理函数
**Vue Router 简介**
它是一个Vue.js官方提供的路由管理器。是一个功能更加强大的前端路由器,推荐使用。
Vue Router和Vue.js非常契合,可以一起方便的实现SPA(single page web application,单页应用程序)应用程序的开发。
Vue Router依赖于Vue,所以需要先引入Vue,再引入Vue Router
**Vue Router的功能**
嵌套路由映射
动态路由选择
模块化、基于组件的路由配置
路由参数、查询、通配符
展示由 Vue.js 的过渡系统提供的过渡效果
细致的导航控制
自动激活 CSS 类的链接
HTML5 history 模式或 hash 模式
可定制的滚动行为
URL 的正确编码
<br>
<div style="color: pink;">小测试:</div >
根据上方资料,以下对于vue-router说法不正确的是?<br/><br/>
## 答案
vue-router不支持模块化、基于组件的路由配置
## 选项
### A
vue-router可以嵌套路由映射
### B
vue-router借助Vue实现响应式的路由,因此只能用于vue
### C
vue-router 的常用模式有hash和history两种
......@@ -2,7 +2,9 @@
"node_id": "vue-c6f3a75adadc4901a88a307fb1ee2f07",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
{
"node_id": "vue-21523e14fb6b466d8538835e35bffe08",
"keywords": [],
"keywords": [
"路由安装",
"Vue路由",
"Vue-route"
],
"children": [],
"export": [],
"keywords_must": [],
"export": [
"exercises.json"
],
"keywords_must": [
"Vue"
],
"keywords_forbid": []
}
\ No newline at end of file
......@@ -2,7 +2,9 @@
"node_id": "vue-35a33dafa3c74a3584269e6317cd7e09",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
......@@ -2,7 +2,9 @@
"node_id": "vue-9e9a0c24d86044d48b8e9c8220b8e112",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
......@@ -2,7 +2,9 @@
"node_id": "vue-0e8b0f72e699442f8008a8ba78b9a05e",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
......@@ -2,7 +2,9 @@
"node_id": "vue-2e2517cbf7234b6da6951b30e050dda9",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
......@@ -2,7 +2,9 @@
"node_id": "vue-1dc4d9ad634f4b2ab0fbae0dd628789e",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
......@@ -2,7 +2,9 @@
"node_id": "vue-c8641c7598f24c51b4942259491f7bd0",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
......@@ -2,7 +2,9 @@
"node_id": "vue-d9946cf901924a2ca1a649ad9866ed99",
"keywords": [],
"children": [],
"export": [],
"export": [
"exercises.json"
],
"keywords_must": [],
"keywords_forbid": []
}
\ No newline at end of file
......@@ -428,18 +428,29 @@
{
"vue-router是什么?": {
"node_id": "vue-ffb7401f51a7483bb21eaa81827c0e73",
"keywords": [],
"keywords": [
"Vue路由",
"VueRoute是什么"
],
"children": [],
"keywords_must": [],
"keywords_must": [
"Vue"
],
"keywords_forbid": []
}
},
{
"路由安装": {
"node_id": "vue-21523e14fb6b466d8538835e35bffe08",
"keywords": [],
"keywords": [
"路由安装",
"Vue路由",
"Vue-route"
],
"children": [],
"keywords_must": [],
"keywords_must": [
"Vue"
],
"keywords_forbid": []
}
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册