router/index.jsimport Vue from 'vue'import VueRouter from 'vue-router'Vue.use(VueRouter)const route = new VueRouter({ routes:[
{ path:'/song/list',component: require('../views/song_list')
},{ path:'/singer/list',component: require('../views/singer_list')
},{ path:'/custom/list',component: require('../views/custom_list')
},{ path:'*',redirect:'/song/list'
}
]
})export default route;头部导航this.$router.push({path:this.headTabs[index].path})子页面每次都会重载(打印'song_list加载了')created (){ console.log('song_list加载了') this.reqSongList();
var mySwiper = new Swiper('.swiper-container', { direction: 'horizontal',
loop: true, autoplay : 3000, pagination: '.swiper-pagination'
});
}看别人的例子都是加载一次后,再次切换时都是直接显示了(没有加动态参数),没有重载(触发created)
添加回答
举报
0/150
提交
取消