前端页面的连接通过页面跳转,有时候需要解析url地址传递的参数,记录方法,
完整url可以用 window.location.href
路由路径可以用 this.
r
o
u
t
e
.
p
a
t
h
路
由
路
径
参
数
t
h
i
s
.
route.path 路由路径参数 this.
route.path路由路径参数this.route.params 例如:/videoLearn/:course_id→ /videoLearn/1234567 → this.
r
o
u
t
e
.
p
a
r
a
m
s
.
c
o
u
r
s
e
i
d
路
由
查
询
参
数
t
h
i
s
.
route.params.course_id 路由查询参数 this.
route.params.courseid路由查询参数this.route.query 例如:/user/search?course_id=1234567→ this.$route.query.course_id
前端vue解析url地址
最新推荐文章于 2024-10-11 09:11:17 发布