Below is the code I am using to set up VueJS routes and pass them into a router:
export const routesArray = {
routes: [
{
path: '/',
name: 'Add Stash',
component: Form
},
{
path: '/log',
name: 'Stash Log',
component: Stitch
},
{
path: '/user/register',
name: 'Register',
component: Register
},
{
path: '/user/login',
name: 'Log in',
component: Login
}
]
}
export default new Router(routesArray)
I have imported this code into a Vue Component and used it to iterate through the array, dynamically generating navigation as shown below:
<ul class="nav">
<li v-for="item in routes">
<a :href="item.path"> {{item.name}}</a>
</li>
The navigation display works perfectly, but clicking on a navigation item leads to a broken link: http://localhost:8080/log#/
Instead of the desired link format like this: http://localhost:8080/#/log
I am unsure how to bypass the hash. Any suggestions or ideas?