Vue router changing the url but not the content

In Songs component I have a list of other albums, so whenever I click on one it should redirect me on /songs/:id. Each album has it’s own id.

This is working from Home or any other component, but whenever I try to go from for example /songs/1 to /songs/2, it doesn’t work. The URL changes but the webpage stays the same.

Here is my router index.js file.

import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
  },
  {
    path: '/songs/:id',
    name: 'Songs',
    component: () => import('../views/Songs.vue')
  },
  {
    path: '/videos/:title/:index',
    name: 'Videos',
    component: () => import('../views/Videos.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router

I was googling a little but nothing seems to work for me.

120 thoughts on “Vue router changing the url but not the content”

  1. I loved as much as you will receive carried out right here.
    The sketch is attractive, your authored subject matter stylish.

    nonetheless, you command get bought an nervousness over that you wish be delivering the following.
    unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this hike. http://cleckleyfloors.com/

    Reply
  2. Pingback: ivermectin capsule
  3. Pingback: prednisone 100 mg
  4. Pingback: stromectol de 6 mg
  5. Pingback: soolantra for sale

Leave a Comment