I have set up my router with the following configurations:
export default new Router({
mode: 'hash',
linkActiveClass: 'open active',
scrollBehavior: () => ({ y: 0 }),
routes: [
{
path: '/',
....
In one of my .vue files, I have a logout function defined like this:
logout () {
this.$router.push('/logout')
}
When the app is running, the current path is:
www.mydomain.com/app#/router_paths
So when I invoke the logout function described above, I get redirected to:
www.mydomain.com/app#/logout
I attempted to use the following code snippet for the logout option:
<b-dropdown-item ><i class="fa fa-lock"></i> <a href="logout">Logout</a> </b-dropdown-item>
Although this hardcoded approach works locally and on the server, hovering over the link displays:
www.mydomain.com/logout
But clicking it does not lead to any redirection.
Is there a way to instruct the router to redirect to
www.mydomain.com/logout
(without hard coding it directly in the code - as I need it to work both locally and on deployed instances)?