javascript - What is the difference between vue params and query
漂亮男人
漂亮男人 2017-05-19 10:25:58
0
1
429
this.$router.push({
                name: 'A',
                query: {
                    id: 1,
                    name: 'a',
                }
            });
this.$router.push({
                name: 'B',
                params: {
                    id: 1,
                    name: 'b',
                }
            });

Except for the different address? What's the difference? I feel like these two have the same effect.

When to use query and when to use params? Or are they basically the same?

漂亮男人
漂亮男人

reply all(1)
大家讲道理

/data/:id这个路由匹配/data/1,/data/2The id here is called params

/data?id=1 /data?id=2 The id here is called query

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template