I faced a problem when I am in user profile and tried to go to another profile the URL change but the component doesn’t reload so I used :key="$route.path" in order to reload the component but there are problems each user profile have different URLs like about and photos and different things the problem is when I am in about and going to photos the component reload
What my purpose
how I can don’t use :key="$route.path" when I am in the same $route.params.username
My profile component
<div class="profile-menu-top">
{{user.username}}
{{user.num_followers}} followers
</div>
<div class="profile-menu">
<router-link :to="{ name: 'Account', params: { username: $route.params.username}}" class="profile-menu-link ">Timeline</router-link>
<router-link :to="{ name: 'UserAbout', params: { username: $route.params.username }}" class="profile-menu-link ">About</router-link>
<router-link :to="{ name: 'MyAccount'}" class="profile-menu-link ">Videos</router-link>
<router-link :to="{ name: 'MyAccount'}" class="profile-menu-link ">Posts</router-link>
</div>
</div>
the router index
{
path: '/u/:username',
name: 'Account',
component: Account,
},
The profile
<Profile v-if="userAccount" :key="$route.path" />