admin管理员组

文章数量:1606170

1.  在 index.js 设置子路由

import TopList from '@/pages/disc/disc'

{   
  path: '/recommend', name: 'Recommend', component: Recommend, children: [ { path: ':id', component: Disc } ] }

 

2.  在 template 中插入 <router-view></router-view>

 

3.  在需要点击的位置设置点击事件 @click="selectItem(item)"

 

4.  设置方法

methods: {
    selectItem(item) {
      this.$router.push({
          path: `/recommend/${item.dissid}`
      })
    }
}

 

转载于:https://wwwblogs/jy13638593346/p/9395992.html

本文标签: 播放器跳转路由项目音乐