路由跳转改动
This commit is contained in:
parent
6ccb1eb099
commit
99f58f7aff
@ -1,5 +1,7 @@
|
|||||||
// router/index.js
|
// router/index.js
|
||||||
import { createRouter, createWebHistory } from 'vue-router';
|
import { createRouter, createWebHistory } from 'vue-router';
|
||||||
|
import { setupRouterGuards } from './router-guards';
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
@ -42,4 +44,5 @@ router.beforeEach((to, from, next) => {
|
|||||||
}
|
}
|
||||||
next()
|
next()
|
||||||
});
|
});
|
||||||
|
setupRouterGuards(router);
|
||||||
export default router;
|
export default router;
|
||||||
|
6
src/router/router-guards.js
Normal file
6
src/router/router-guards.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
// router/router-guards.js
|
||||||
|
export function setupRouterGuards (router) {
|
||||||
|
router.afterEach(() => {
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
});
|
||||||
|
}
|
@ -365,12 +365,12 @@ import {
|
|||||||
import { useHome } from "@/store/home/index.js";
|
import { useHome } from "@/store/home/index.js";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
pageTitleNo: "",
|
pageTitleNo: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const { currentTab } = useHome();
|
const { currentTab } = useHome();
|
||||||
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
state.pageTitleNo = route.query.titleNo;
|
state.pageTitleNo = route.query.titleNo;
|
||||||
|
@ -363,18 +363,22 @@ import {
|
|||||||
onBeforeMount,
|
onBeforeMount,
|
||||||
} from "vue";
|
} from "vue";
|
||||||
import { useHome } from "@/store/home/index.js";
|
import { useHome } from "@/store/home/index.js";
|
||||||
import { useRoute } from "vue-router";
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
pageTitleNo: "",
|
pageTitleNo: "",
|
||||||
});
|
});
|
||||||
|
import { useRoute, useRouter } from "vue-router";
|
||||||
const { currentTab } = useHome();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const { currentTab } = useHome();
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
state.pageTitleNo = route.query.titleNo;
|
state.pageTitleNo = route.query.titleNo;
|
||||||
});
|
});
|
||||||
onMounted(() => {});
|
onMounted(() => {});
|
||||||
onUnmounted(() => {});
|
onUnmounted(() => {});
|
||||||
|
const handleTabClick = (tab) => {
|
||||||
|
currentTab.value = tab;
|
||||||
|
router.push("/" + tab);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<n-marquee auto-fill>
|
<n-marquee auto-fill>
|
||||||
<div style="display: flex" class="mt-[190px]">
|
<div style="display: flex" class="mt-[190px]">
|
||||||
<div class="text-[#455363] text-[40px] mr-[83px]">
|
<div class="text-[#455363] text-[40px] mr-[83px] w-[500px]">
|
||||||
<img
|
<img
|
||||||
class="w-[475px] h-[475px]"
|
class="w-[475px] h-[475px]"
|
||||||
src="@/assets/image/jj1.png"
|
src="@/assets/image/jj1.png"
|
||||||
@ -104,7 +104,7 @@
|
|||||||
{{ t("home.section3.features.data.desc") }}
|
{{ t("home.section3.features.data.desc") }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-[#455363] text-[40px] mr-[83px]">
|
<div class="text-[#455363] text-[40px] mr-[83px] w-[500px]">
|
||||||
<img
|
<img
|
||||||
class="w-[475px] h-[475px]"
|
class="w-[475px] h-[475px]"
|
||||||
src="@/assets/image/jj2.png"
|
src="@/assets/image/jj2.png"
|
||||||
@ -122,7 +122,7 @@
|
|||||||
{{ t("home.section3.features.ai.desc") }}
|
{{ t("home.section3.features.ai.desc") }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-[#455363] text-[40px] mr-[83px]">
|
<div class="text-[#455363] text-[40px] mr-[83px] w-[500px]">
|
||||||
<img
|
<img
|
||||||
class="w-[475px] h-[475px]"
|
class="w-[475px] h-[475px]"
|
||||||
src="@/assets/image/jj3.png"
|
src="@/assets/image/jj3.png"
|
||||||
@ -140,7 +140,7 @@
|
|||||||
{{ t("home.section3.features.cloud.desc") }}
|
{{ t("home.section3.features.cloud.desc") }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-[#455363] text-[40px] mr-[83px]">
|
<div class="text-[#455363] text-[40px] mr-[83px] w-[500px]">
|
||||||
<img
|
<img
|
||||||
class="w-[475px] h-[475px]"
|
class="w-[475px] h-[475px]"
|
||||||
src="@/assets/image/jj4.png"
|
src="@/assets/image/jj4.png"
|
||||||
@ -158,7 +158,7 @@
|
|||||||
{{ t("home.section3.features.cooperation.desc") }}
|
{{ t("home.section3.features.cooperation.desc") }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-[#455363] text-[40px] mr-[83px]">
|
<div class="text-[#455363] text-[40px] mr-[83px] w-[500px]">
|
||||||
<img
|
<img
|
||||||
class="w-[475px] h-[475px]"
|
class="w-[475px] h-[475px]"
|
||||||
src="@/assets/image/jj5.png"
|
src="@/assets/image/jj5.png"
|
||||||
|
Loading…
Reference in New Issue
Block a user