From a7a3a08ee3823cd1e94e1731118b9926040b04a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=82=85=E5=85=89=E5=AD=9F?= Date: Thu, 12 Feb 2026 22:03:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E8=A1=8C=E4=B8=9A?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=A0=87=E7=AD=BE=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E5=BC=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/concept/components/CustomView.vue | 29 ++++++++++++++------ src/pages/industry/components/CustomView.vue | 28 ++++++++++++++----- 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/src/pages/concept/components/CustomView.vue b/src/pages/concept/components/CustomView.vue index 5bbebb5..9d3d8c3 100644 --- a/src/pages/concept/components/CustomView.vue +++ b/src/pages/concept/components/CustomView.vue @@ -40,7 +40,7 @@ - {{ item.name.split('-')[1] }} + {{ item.name.split("-")[1] }} @@ -61,7 +61,7 @@ :class="['industry-item', { active: isSelected(item.content) }]" @click="handleAddTag(item.content)" > - {{ item.content.split('-')[1] }} + {{ item.content.split("-")[1] }} @@ -106,16 +106,29 @@ const handleBack = () => { }; const myTagList = ref([]); +const industryList = ref([]); const page = ref(0); -const industryList = computed(() => { - const arr = [...props.allTagList] - return arr.splice(page.value, 10); -}); + +const getTagList = () => { + return [...props.allTagList].splice(page.value, 10); +}; const handleChange = () => { - page.value = page.value ? 0 : 10 -} + page.value = page.value ? 0 : 10; + industryList.value = getTagList(); +}; +watch( + () => props.allTagList, + (newVal) => { + if (newVal && newVal.length > 0) { + industryList.value = getTagList(); + } + }, + { + immediate: true, + }, +); // 是否选中 function isSelected(tag) { diff --git a/src/pages/industry/components/CustomView.vue b/src/pages/industry/components/CustomView.vue index 8968266..574e8b3 100644 --- a/src/pages/industry/components/CustomView.vue +++ b/src/pages/industry/components/CustomView.vue @@ -106,15 +106,29 @@ const handleBack = () => { }; const myTagList = ref([]); -const page = ref(0); -const industryList = computed(() => { - const arr = [...props.allTagList] - return arr.splice(page.value, 10); -}); +const industryList = ref([]); +const page = ref(0) + +const getTagList = () => { + return [...props.allTagList].splice(page.value, 10); +}; const handleChange = () => { - page.value = page.value ? 0 : 10 -} + page.value = page.value ? 0 : 10; + industryList.value = getTagList(); +}; + +watch( + () => props.allTagList, + (newVal) => { + if (newVal && newVal.length > 0) { + industryList.value = getTagList(); + } + }, + { + immediate: true, + }, +); // 是否选中 function isSelected(tag) {