R
R
razer962018-08-23 17:39:57
Vue.js
razer96, 2018-08-23 17:39:57

How to remove parameter from this.$router.query in Nuxt.js?

Tell me how to remove a parameter from a request in a Nuxt.js route. Thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Martovitskiy, 2018-08-23
@Martovitskiy

Есть такое решение:

let newRouteQuery = {};
Object.keys(this.$route.query).forEach(function(key){
    if (key != 's')
        newRouteQuery[key] = this.$route.query[key];
});

Антон Швец, 2018-08-23
@Xuxicheta

они ж ридонли. Копируешь и удаляешь из копии.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question