1、router-link
不带参数:
带参数:
params类似post
query类似get
2、this.
r
o
u
t
e
r
.
p
u
s
h
(
)
不带参数:
t
h
i
s
.
router.push() 不带参数: this.
router.push()不带参数:this.router.push(‘/home’)
this.
r
o
u
t
e
r
.
p
u
s
h
(
n
a
m
e
:
′
h
o
m
e
′
)
t
h
i
s
.
router.push({name:'home'}) this.
router.push(name:′home′)this.router.push({path:‘/path’})
query参数:
this.
r
o
u
t
e
r
.
p
u
s
h
(
n
a
m
e
:
′
h
o
m
e
′
,
q
u
e
r
y
:
i
d
:
′
1
′
)
t
h
i
s
.
router.push({name:'home',query:{id:'1'}}) this.
router.push(name:′home′,query:id:′1′)this.router.push({path:‘/home’,query:{id:‘1’}})
params传参:
this.
r
o
u
t
e
r
.
p
u
s
h
(
n
a
m
e
:
′
h
o
m
e
′
,
p
a
r
a
m
s
:
i
d
:
′
1
′
)
不存在
p
a
t
h
的
3
、
t
h
i
s
.
router.push({name:'home',params:{id:'1'}}) 不存在path的 3、this.
router.push(name:′home′,params:id:′1′)不存在path的3、this.router.go(n)