vue组件中的数据传递

vue组件中的数据传递

1.设置要传的参数

1.

<router-link :to="{path:'/xx',query:{xxx:'xxx'}}"></router-link>

2.

//1.
this.$router.push('/xxx' + xxx)
//2.
this.$router.push(
{
    
    
    path:'/xxx',
    query:{
    
    xxx:xxx,...}
}
)

2.获取参数

$route.query.xxx

猜你喜欢

转载自blog.csdn.net/qq_44255146/article/details/115964993
今日推荐