[Vuejs]-How to set the dynamic search parameter correctly in the url?

1👍

Yes, you need to use backticks to be able to use string interpolation

But the code you posted doesn’t make much sense in a real world scenario.
If you’re sending a search parameter to the API then one would expect you’re going to get filtered data.
That means you don’t have to filter it yourself.

Also, you’re assigning a lot of variables which you don’t use later on. What’s the purpose of searchUrl and local variables?

Leave a comment