父应用:
import microApp from '@micro-zoe/micro-app'
microApp.start()
<micro-app :name="name" :url="url" iframe router-mode='native' keep-alive></micro-app>
子应用中路由跳转:
router.push({
path: `/MF_customer/${path}`,
query: {
a: 1
}
});
}
跳转后地址栏中的url发生了变化
但是父应用中监听router变化不触发
import { useRouter} from 'vue-router'
const router = useRouter()
watch(
() => router.currentRoute.value,
(newValue: any) => {
console.log('newValue',newValue)
},
{ immediate: true }
)
我需要在路由变化的时候去改变菜单的选中状态,请问如何解决