perf: 调整

This commit is contained in:
rd
2025-08-25 09:53:46 +08:00
parent a1c51cbca0
commit db9b53821b
3 changed files with 13 additions and 8 deletions

View File

@ -19,11 +19,12 @@ export default defineComponent({
const route = useRoute();
const router = useRouter();
const activeKey = ref('1');
const activeKey = ref('');
onMounted(() => {
activeKey.value = TABS.find((item) => item.routeName === route.name)?.key;
});
return () => (
<div class="material-center-wrap h-full flex flex-col">
<header class="py-16px px-24px rounded-8px bg-#fff flex items-center mb-16px">
@ -34,7 +35,7 @@ export default defineComponent({
item.key === activeKey.value ? '!color-#6D4CFE font-500' : ''
}`}
onClick={() => {
activeKey.value = item.key;
activeKey.value = '';
router.push({ name: item.routeName });
}}
>
@ -42,7 +43,7 @@ export default defineComponent({
</p>
))}
</header>
{activeKey.value === '1' ? <FinishedProducts /> : <RawMaterial />}
{activeKey.value === '1' ? <FinishedProducts /> : activeKey.value === '2' ? <RawMaterial /> : null}{' '}
</div>
);
},