vue3.0 CLI – 3.2 路由的初级使用教程

machao79339 13 0 PDF 2021-02-01 10:02:19

我的 github 地址 -vue3.0Study – 阶段学习成果都会建立分支。 ========================== 动态路由 在路由某部分里加入[ : ],就成为动态路由如:/user/:id/,那么路由导航,并不是 /user/id/ 而是 /user/666/。 显然这个 id 能被获取,在组件中使用。通过 this.$route.params 获取。 this 是当前组件,$route 是路由对象,params 是一个对象字面量 { id:666 }。 $route 通过 Vue.use(Router) 和 new Vue({ router, store, ren

用户评论
请输入评论内容
评分:
暂无评论