I am facing an issue with my user list and calendar components. Whenever I click on a user link, I want only the selectedUser parameter in the URL to change while leaving all other parameters unchanged.
Currently, when I click on the "Change date" link, it updates the date. However, if I then click on a user link, it still shows the old date that was rendered previously.
URL: /users/John/month/2019/01 after clicking on "Change date" - /users/John/month/2009/09
Subsequently, clicking on a different user reverts back to the old date like so: /users/Bob/month/2019/01
The user link code is as follows:
<li v-for="user in users">
<router-link
:class="{ active: user.id == selected }"
:to="{ name: 'MainRoute', params: { selectedUser: user.id }}">
{{ user.username }}
</router-link>
</li>
On the other hand, the calendar link for changing dates looks like this:
<router-link
:to="{ name: 'MainRoute', params: { selectedMonth: '09', selectedYear: '2009' }}">
Change date
</router-link>
Below is my routes object configuration:
{
name: 'MainRoute',
path: '/users/:selectedUser/:selectedView/:selectedYear/:selectedMonth',
...
}