Encountering challenges with VueJS during my first attempt at using it
- The majority of my page template is stored in the index.html file located in the root directory
- I have implemented 3 components, each containing the main content body for different 'pages'
Here is an overview of my router:
export default new Router({
mode: 'history',
hash: false,
routes: [
{
path: '/',
name: 'Home',
component: Home
},
{
path: '/gallery',
name: 'Gallery',
component: Gallery
},
{
path: '/contact',
name: 'Contact',
component: Contact
}
]
})
I am facing issues while trying to implement
<router-link :to="{ name: 'Gallery' }">Gallery</router-link>
- the anchor tags are not rendering correctly in my index.html file (I may not fully understand where and how Vue can be applied) - hence resorting to a standard link format like this: <a class="nav-link" href="/gallery">Gallery</a>
The core issue is:
Although all the code works perfectly on my local machine, it fails to function properly when I deploy it anywhere else (particularly interested in getting it to work on Netlify). Services like Netlify tend to overwrite my configurations that remove the hash, resulting in links being directed to incorrect URL formats like this:
https://examplesite.com/#/ => https://examplesite.com/gallery#/