From 3fc52011268e0094adbce3e537d69dff4997d234 Mon Sep 17 00:00:00 2001 From: asd <374367073@qq.com> Date: Mon, 9 Dec 2019 09:50:31 +0800 Subject: [PATCH] update --- 2019/12/vue-router.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/2019/12/vue-router.md b/2019/12/vue-router.md index 5468e51..a18bb72 100644 --- a/2019/12/vue-router.md +++ b/2019/12/vue-router.md @@ -166,8 +166,13 @@ export default { 2.使用: 动态路径参数 用: 开头 (1)在main.js 的路由定义中: + { path: "/a", component: aa }, + 修改为: + { path: "/a/:参数名", component: 映射的组件名 }, + (2) 在映射的组件中获取传入的动态参数的值 -在 \ No newline at end of file + +在引入的组件中 使用 {{ $route.params.id }} 获取参数的值