feat: player goback
This commit is contained in:
@@ -40,8 +40,19 @@ const router = createRouter({
|
|||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
router.beforeEach((to, from) => {
|
router.beforeEach((to, from, next) => {
|
||||||
|
to.meta.from = {
|
||||||
|
name: from.name,
|
||||||
|
params: from.params,
|
||||||
|
}
|
||||||
console.log("from", from, "goto: ", to)
|
console.log("from", from, "goto: ", to)
|
||||||
|
|
||||||
|
next()
|
||||||
|
// if (from.matched.length === 0) {
|
||||||
|
// next({ name: 'tab.home', params: to.params })
|
||||||
|
// } else {
|
||||||
|
// next()
|
||||||
|
// }
|
||||||
})
|
})
|
||||||
|
|
||||||
export default router
|
export default router
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ import Hls from "hls.js";
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
|
console.log("router: ", router);
|
||||||
|
console.log("route: ", route.meta);
|
||||||
|
|
||||||
const item = ref({
|
const item = ref({
|
||||||
title: "加载中...",
|
title: "加载中...",
|
||||||
})
|
})
|
||||||
@@ -73,7 +76,16 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const onClickLeft = () => {
|
const onClickLeft = () => {
|
||||||
router.back();
|
if (route.meta.from?.name) {
|
||||||
|
router.back()
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
router.replace({
|
||||||
|
name: 'tab.home',
|
||||||
|
params: {
|
||||||
|
tenant: route.params.tenant
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user