From fa41281934d4f210b9126926cc1aa92d204b725e Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Tue, 18 Apr 2023 20:37:39 +0800 Subject: [PATCH] 123 --- src/store/modules/detail.js | 8 ++++++++ src/views/Index/components/CaseDetails/index.vue | 10 ++++++---- src/views/Index/components/HardwareDetails/index.vue | 10 ++++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/store/modules/detail.js b/src/store/modules/detail.js index d32f6c1..eb43da8 100644 --- a/src/store/modules/detail.js +++ b/src/store/modules/detail.js @@ -9,10 +9,18 @@ export const useDetailStore = defineStore({ hardwareExampleId: '1', hardware_id: '1', showRecruitDetail: false, + componentKey_case: 0, + componentKey_hardware: 0, } }, // actions actions: { + changeComponentKeyCase() { + this.componentKey_case++ + }, + changeComponentKeyHardware() { + this.componentKey_hardware++ + }, changeRecruitDetail(flag) { this.showRecruitDetail = flag }, diff --git a/src/views/Index/components/CaseDetails/index.vue b/src/views/Index/components/CaseDetails/index.vue index f7cc1ed..455d718 100644 --- a/src/views/Index/components/CaseDetails/index.vue +++ b/src/views/Index/components/CaseDetails/index.vue @@ -16,7 +16,10 @@ }}

-
+
详情页
@@ -128,12 +131,11 @@ const modules = ref([Pagination]) const detailStore = useDetailStore() const swiperStore = useSwiperStore() const { industry_id, example_id } = storeToRefs(detailStore) -const componentKey = ref(0) const pagination = { clickable: true, } const forceRerender = () => { - componentKey.value = 1 + componentKey.value + detailStore.changeComponentKeyCase() } const funcToSon = () => { forceRerender() diff --git a/src/views/Index/components/HardwareDetails/index.vue b/src/views/Index/components/HardwareDetails/index.vue index e001d35..e18bb89 100644 --- a/src/views/Index/components/HardwareDetails/index.vue +++ b/src/views/Index/components/HardwareDetails/index.vue @@ -16,7 +16,10 @@ }}

-
+
详情页
@@ -129,9 +132,8 @@ const modules = ref([Pagination]) const detailStore = useDetailStore() const swiperStore = useSwiperStore() const { hardware_id, hardwareExampleId } = storeToRefs(detailStore) -const componentKey = ref(0) const forceRerender = () => { - componentKey.value = 1 + componentKey.value + detailStore.changeComponentKeyHardware() } const pagination = { clickable: true,