vue this.$router.push query传递对象方法

this.$router.push({
    path: '/home',
    query: {
        params: JSON.stringify({ name: 'lokka', age: 18 })
    }
});

let params = JSON.parse(this.$route.query.params)
this.name = params.name; 
this.age = params.age;
posted @ 2022-09-19 22:18  xuelin  阅读(52)  评论(0编辑  收藏  举报