From c10af99bb6639ec4b66c0e639361307917550d20 Mon Sep 17 00:00:00 2001 From: yangyin <1850366751@qq.com> Date: 星期五, 22 十一月 2024 11:11:05 +0800 Subject: [PATCH] 修改第五步空白的问题 --- src/views/project/ch/home/component/waterRight/bottom.vue | 23 ++++++++--------------- 1 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/views/project/ch/home/component/waterRight/bottom.vue b/src/views/project/ch/home/component/waterRight/bottom.vue index b7b1018..8e5396a 100644 --- a/src/views/project/ch/home/component/waterRight/bottom.vue +++ b/src/views/project/ch/home/component/waterRight/bottom.vue @@ -48,8 +48,8 @@ </template> <script setup lang="ts"> -import { computed, reactive, ref, watch } from 'vue'; -import { activeGroupType, sceneGroupList, sectionAList, topGroupId } from '/@/stores/chatRoom'; +import { computed, reactive, ref } from 'vue'; +import { activeGroupType, sceneGroupList, topGroupId } from '/@/stores/chatRoom'; let state = reactive({ applicationScenarios: [], scenariosIds: [], @@ -95,18 +95,15 @@ const iconCount = iconList.value.length; return iconList.value[index % iconCount]; }; -const getMainSectionList = (val) => { +const getMainSectionList = async () => { let result = []; - console.log('馃殌 ~ sceneGroupList.value:', sceneGroupList.value); - sceneGroupList.value.forEach((sectionItem, index) => { + await sceneGroupList.value.forEach((sectionItem, index) => { sectionItem.Icon = getIconByIndex(index); - if (val == sectionItem.group_type) { + if (activeGroupType.value == sectionItem.group_type) { result.push(sectionItem); } }); state.applicationScenarios = result; - console.log("馃殌 ~ 涓诲満鏅鐞嗗悗鐨勬暟鎹簮:", result) - sectionAList.value = sceneGroupList.value; result?.[0] && changeScenarios(result[0]); }; const groupedArray = computed(() => { @@ -117,13 +114,9 @@ } return groups; }); -watch( - () => activeGroupType.value, - (val) => { - getMainSectionList(val); - }, - { immediate: true } -); +defineExpose({ + getMainSectionList, +}); </script> <style scoped lang="scss"> .pc-scenes { -- Gitblit v1.9.3