我在其他頁面this.$router.go('/')它會跳到Index(首頁),我想home里v-header和v-sidebar組件數(shù)據也得重新刷新一下,home作為根組件各種跳轉只會在他里面跳,home本身里面的組件并不會刷新,請問有沒有辦法,我在別的頁面返回index的時候,連同home里的組件一起刷新,以下是我路由和home模版代碼 routes: [{
path: '',
component: Home,
children: [{
path: '/',
component: Index,
name: "Index",
},
{
path: '/goods',
component: GoodsRelease,
}
]}]home模版<template>
<div>
<v-header></v-header>
<div class="wrapper">
<v-sidebar></v-sidebar>
<div class="content">
<transition name="slide-fade" mode="out-in">
<router-view></router-view>
</transition>
</div>
</div>
</div></template>
1 回答

慕妹3242003
TA貢獻1824條經驗 獲得超6個贊
可以箭頭路由變化 實現(xiàn)數(shù)據更新 :
watch: { $route (to, from) { //對應數(shù)據更新操作 } }
添加回答
舉報
0/150
提交
取消