From 5e834d7a7233c76c8146cf2a02e5868f829f4816 Mon Sep 17 00:00:00 2001 From: zhaoss Date: Wed, 20 Apr 2022 13:24:11 +0800 Subject: [PATCH] =?UTF-8?q?2.2.1=E5=B0=8F=E8=8A=82=E4=B9=A0=E9=A2=98?= =?UTF-8?q?=E3=80=81=E5=85=B3=E9=94=AE=E5=AD=97=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercises.json" | 2 +- .../config.json" | 13 ++++- .../exercises.json" | 7 +++ .../exercises.md" | 56 +++++++++++++++++++ .../config.json" | 4 +- .../config.json" | 14 ++++- .../config.json" | 4 +- .../config.json" | 4 +- .../config.json" | 4 +- .../config.json" | 4 +- .../config.json" | 4 +- .../config.json" | 4 +- .../config.json" | 4 +- data/tree.json | 19 +++++-- 14 files changed, 124 insertions(+), 19 deletions(-) create mode 100644 "data/2.Vue\344\270\255\351\230\266/2.Vue-router/1.vue-router\346\230\257\344\273\200\344\271\210\357\274\237/exercises.json" create mode 100644 "data/2.Vue\344\270\255\351\230\266/2.Vue-router/1.vue-router\346\230\257\344\273\200\344\271\210\357\274\237/exercises.md" diff --git "a/data/2.Vue\344\270\255\351\230\266/1.Vue\347\273\204\344\273\266/5.\345\212\250\346\200\201\347\273\204\344\273\266\343\200\201\345\274\202\346\255\245\347\273\204\344\273\266/exercises.json" "b/data/2.Vue\344\270\255\351\230\266/1.Vue\347\273\204\344\273\266/5.\345\212\250\346\200\201\347\273\204\344\273\266\343\200\201\345\274\202\346\255\245\347\273\204\344\273\266/exercises.json" index fda1cdf..db3c53a 100644 --- "a/data/2.Vue\344\270\255\351\230\266/1.Vue\347\273\204\344\273\266/5.\345\212\250\346\200\201\347\273\204\344\273\266\343\200\201\345\274\202\346\255\245\347\273\204\344\273\266/exercises.json" +++ "b/data/2.Vue\344\270\255\351\230\266/1.Vue\347\273\204\344\273\266/5.\345\212\250\346\200\201\347\273\204\344\273\266\343\200\201\345\274\202\346\255\245\347\273\204\344\273\266/exercises.json" @@ -1,6 +1,6 @@ { "type": "code_options", - "author": null, + "author": "zhaoss", "source": "exercises.md", "notebook_enable": false, "exercise_id": "51b47b0ce6e0488390f51225751a2424" diff --git "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/1.vue-router\346\230\257\344\273\200\344\271\210\357\274\237/config.json" "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/1.vue-router\346\230\257\344\273\200\344\271\210\357\274\237/config.json" index 53404cf..ca7949b 100644 --- "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/1.vue-router\346\230\257\344\273\200\344\271\210\357\274\237/config.json" +++ "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/1.vue-router\346\230\257\344\273\200\344\271\210\357\274\237/config.json" @@ -1,8 +1,15 @@ { "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 diff --git "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/1.vue-router\346\230\257\344\273\200\344\271\210\357\274\237/exercises.json" "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/1.vue-router\346\230\257\344\273\200\344\271\210\357\274\237/exercises.json" new file mode 100644 index 0000000..3f658ac --- /dev/null +++ "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/1.vue-router\346\230\257\344\273\200\344\271\210\357\274\237/exercises.json" @@ -0,0 +1,7 @@ +{ + "type": "code_options", + "author": null, + "source": "exercises.md", + "notebook_enable": false, + "exercise_id": "ae1fe8c628e74e8790d3a216d7d78fe0" +} \ No newline at end of file diff --git "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/1.vue-router\346\230\257\344\273\200\344\271\210\357\274\237/exercises.md" "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/1.vue-router\346\230\257\344\273\200\344\271\210\357\274\237/exercises.md" new file mode 100644 index 0000000..1e7021b --- /dev/null +++ "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/1.vue-router\346\230\257\344\273\200\344\271\210\357\274\237/exercises.md" @@ -0,0 +1,56 @@ +# vue-router是什么? + +
小常识:
+
+ +**概念** +路由的本质就是一种对应关系,比如说我们在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 的正确编码 +
+ +
小测试:
+ +根据上方资料,以下对于vue-router说法不正确的是?

+ +## 答案 + +vue-router不支持模块化、基于组件的路由配置 + +## 选项 + +### A + +vue-router可以嵌套路由映射 + +### B + +vue-router借助Vue实现响应式的路由,因此只能用于vue + +### C + +vue-router 的常用模式有hash和history两种 diff --git "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/10.\345\220\216\347\275\256\350\267\257\347\224\261\345\256\210\345\215\253/config.json" "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/10.\345\220\216\347\275\256\350\267\257\347\224\261\345\256\210\345\215\253/config.json" index ee9deb1..dc70abc 100644 --- "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/10.\345\220\216\347\275\256\350\267\257\347\224\261\345\256\210\345\215\253/config.json" +++ "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/10.\345\220\216\347\275\256\350\267\257\347\224\261\345\256\210\345\215\253/config.json" @@ -2,7 +2,9 @@ "node_id": "vue-c6f3a75adadc4901a88a307fb1ee2f07", "keywords": [], "children": [], - "export": [], + "export": [ + "exercises.json" + ], "keywords_must": [], "keywords_forbid": [] } \ No newline at end of file diff --git "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/2.\350\267\257\347\224\261\345\256\211\350\243\205/config.json" "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/2.\350\267\257\347\224\261\345\256\211\350\243\205/config.json" index 0ef1c62..a8a3a54 100644 --- "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/2.\350\267\257\347\224\261\345\256\211\350\243\205/config.json" +++ "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/2.\350\267\257\347\224\261\345\256\211\350\243\205/config.json" @@ -1,8 +1,16 @@ { "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 diff --git "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/3.\347\274\226\347\250\213\345\274\217\347\232\204\345\257\274\350\210\252/config.json" "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/3.\347\274\226\347\250\213\345\274\217\347\232\204\345\257\274\350\210\252/config.json" index d0d9527..92e9ec9 100644 --- "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/3.\347\274\226\347\250\213\345\274\217\347\232\204\345\257\274\350\210\252/config.json" +++ "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/3.\347\274\226\347\250\213\345\274\217\347\232\204\345\257\274\350\210\252/config.json" @@ -2,7 +2,9 @@ "node_id": "vue-35a33dafa3c74a3584269e6317cd7e09", "keywords": [], "children": [], - "export": [], + "export": [ + "exercises.json" + ], "keywords_must": [], "keywords_forbid": [] } \ No newline at end of file diff --git "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/4.router-link\347\273\204\344\273\266\347\232\204\344\275\277\347\224\250/config.json" "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/4.router-link\347\273\204\344\273\266\347\232\204\344\275\277\347\224\250/config.json" index 32a5d35..46972d8 100644 --- "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/4.router-link\347\273\204\344\273\266\347\232\204\344\275\277\347\224\250/config.json" +++ "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/4.router-link\347\273\204\344\273\266\347\232\204\344\275\277\347\224\250/config.json" @@ -2,7 +2,9 @@ "node_id": "vue-9e9a0c24d86044d48b8e9c8220b8e112", "keywords": [], "children": [], - "export": [], + "export": [ + "exercises.json" + ], "keywords_must": [], "keywords_forbid": [] } \ No newline at end of file diff --git "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/5.\345\212\250\346\200\201\350\267\257\347\224\261/config.json" "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/5.\345\212\250\346\200\201\350\267\257\347\224\261/config.json" index 7ff392b..75d678a 100644 --- "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/5.\345\212\250\346\200\201\350\267\257\347\224\261/config.json" +++ "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/5.\345\212\250\346\200\201\350\267\257\347\224\261/config.json" @@ -2,7 +2,9 @@ "node_id": "vue-0e8b0f72e699442f8008a8ba78b9a05e", "keywords": [], "children": [], - "export": [], + "export": [ + "exercises.json" + ], "keywords_must": [], "keywords_forbid": [] } \ No newline at end of file diff --git "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/6.\350\267\257\347\224\261\347\273\204\344\273\266\344\274\240\345\217\202/config.json" "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/6.\350\267\257\347\224\261\347\273\204\344\273\266\344\274\240\345\217\202/config.json" index 7ea93aa..87715b0 100644 --- "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/6.\350\267\257\347\224\261\347\273\204\344\273\266\344\274\240\345\217\202/config.json" +++ "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/6.\350\267\257\347\224\261\347\273\204\344\273\266\344\274\240\345\217\202/config.json" @@ -2,7 +2,9 @@ "node_id": "vue-2e2517cbf7234b6da6951b30e050dda9", "keywords": [], "children": [], - "export": [], + "export": [ + "exercises.json" + ], "keywords_must": [], "keywords_forbid": [] } \ No newline at end of file diff --git "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/7.\350\267\257\347\224\261\351\207\215\345\256\232\345\220\221/config.json" "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/7.\350\267\257\347\224\261\351\207\215\345\256\232\345\220\221/config.json" index b66711e..cf7ab1d 100644 --- "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/7.\350\267\257\347\224\261\351\207\215\345\256\232\345\220\221/config.json" +++ "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/7.\350\267\257\347\224\261\351\207\215\345\256\232\345\220\221/config.json" @@ -2,7 +2,9 @@ "node_id": "vue-1dc4d9ad634f4b2ab0fbae0dd628789e", "keywords": [], "children": [], - "export": [], + "export": [ + "exercises.json" + ], "keywords_must": [], "keywords_forbid": [] } \ No newline at end of file diff --git "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/8.\350\267\257\347\224\261\346\250\241\345\274\217/config.json" "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/8.\350\267\257\347\224\261\346\250\241\345\274\217/config.json" index 3735aa0..7fac376 100644 --- "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/8.\350\267\257\347\224\261\346\250\241\345\274\217/config.json" +++ "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/8.\350\267\257\347\224\261\346\250\241\345\274\217/config.json" @@ -2,7 +2,9 @@ "node_id": "vue-c8641c7598f24c51b4942259491f7bd0", "keywords": [], "children": [], - "export": [], + "export": [ + "exercises.json" + ], "keywords_must": [], "keywords_forbid": [] } \ No newline at end of file diff --git "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/9.\345\211\215\347\275\256\350\267\257\347\224\261\345\256\210\345\215\253/config.json" "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/9.\345\211\215\347\275\256\350\267\257\347\224\261\345\256\210\345\215\253/config.json" index d8f9cdd..4851b3e 100644 --- "a/data/2.Vue\344\270\255\351\230\266/2.Vue-router/9.\345\211\215\347\275\256\350\267\257\347\224\261\345\256\210\345\215\253/config.json" +++ "b/data/2.Vue\344\270\255\351\230\266/2.Vue-router/9.\345\211\215\347\275\256\350\267\257\347\224\261\345\256\210\345\215\253/config.json" @@ -2,7 +2,9 @@ "node_id": "vue-d9946cf901924a2ca1a649ad9866ed99", "keywords": [], "children": [], - "export": [], + "export": [ + "exercises.json" + ], "keywords_must": [], "keywords_forbid": [] } \ No newline at end of file diff --git a/data/tree.json b/data/tree.json index 403616c..d97ffd1 100644 --- a/data/tree.json +++ b/data/tree.json @@ -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": [] } }, -- GitLab