perf: Improve List render perfermance when grid is undefined

pull/5361/head
tangjinzhou 3 years ago
parent fa9f1f4f53
commit 67939d3399

@ -200,7 +200,12 @@ const List = defineComponent({
return dd; return dd;
}); });
const screens = useBreakpoint(); const needResponsive = computed(() =>
Object.keys(props.grid || {}).some(key =>
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].includes(key),
),
);
const screens = useBreakpoint(needResponsive);
const currentBreakpoint = computed(() => { const currentBreakpoint = computed(() => {
for (let i = 0; i < responsiveArray.length; i += 1) { for (let i = 0; i < responsiveArray.length; i += 1) {

Loading…
Cancel
Save