perf: 调整
This commit is contained in:
@ -110,8 +110,8 @@ const props = defineProps({
|
|||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
rowSelection: {
|
rowSelection: {
|
||||||
type: Array,
|
type: Object,
|
||||||
default: () => [],
|
default: () => {},
|
||||||
},
|
},
|
||||||
selectedRowKeys: {
|
selectedRowKeys: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
|||||||
@ -19,7 +19,7 @@ export default defineComponent({
|
|||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const activeKey = ref('1');
|
const activeKey = ref('');
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
activeKey.value = TABS.find((item) => item.routeName === route.name)?.key;
|
activeKey.value = TABS.find((item) => item.routeName === route.name)?.key;
|
||||||
@ -34,7 +34,7 @@ export default defineComponent({
|
|||||||
item.key === activeKey.value ? '!color-#6D4CFE font-500' : ''
|
item.key === activeKey.value ? '!color-#6D4CFE font-500' : ''
|
||||||
}`}
|
}`}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
activeKey.value = item.key;
|
activeKey.value = '';
|
||||||
router.push({ name: item.routeName });
|
router.push({ name: item.routeName });
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -42,7 +42,11 @@ export default defineComponent({
|
|||||||
</p>
|
</p>
|
||||||
))}
|
))}
|
||||||
</header>
|
</header>
|
||||||
{activeKey.value === '1' ? <FinishedProducts /> : <RawMaterial />}
|
{activeKey.value === '1' ? (
|
||||||
|
<FinishedProducts />
|
||||||
|
) : activeKey.value === '2' ? (
|
||||||
|
<RawMaterial />
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -19,11 +19,12 @@ export default defineComponent({
|
|||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const activeKey = ref('1');
|
const activeKey = ref('');
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
activeKey.value = TABS.find((item) => item.routeName === route.name)?.key;
|
activeKey.value = TABS.find((item) => item.routeName === route.name)?.key;
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => (
|
return () => (
|
||||||
<div class="material-center-wrap h-full flex flex-col">
|
<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">
|
<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' : ''
|
item.key === activeKey.value ? '!color-#6D4CFE font-500' : ''
|
||||||
}`}
|
}`}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
activeKey.value = item.key;
|
activeKey.value = '';
|
||||||
router.push({ name: item.routeName });
|
router.push({ name: item.routeName });
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -42,7 +43,7 @@ export default defineComponent({
|
|||||||
</p>
|
</p>
|
||||||
))}
|
))}
|
||||||
</header>
|
</header>
|
||||||
{activeKey.value === '1' ? <FinishedProducts /> : <RawMaterial />}
|
{activeKey.value === '1' ? <FinishedProducts /> : activeKey.value === '2' ? <RawMaterial /> : null}{' '}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user