Skip to content

Commit 67939d3

Browse files
committed
perf: Improve List render perfermance when grid is undefined
1 parent fa9f1f4 commit 67939d3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/list/index.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,12 @@ const List = defineComponent({
200200
return dd;
201201
});
202202

203-
const screens = useBreakpoint();
203+
const needResponsive = computed(() =>
204+
Object.keys(props.grid || {}).some(key =>
205+
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].includes(key),
206+
),
207+
);
208+
const screens = useBreakpoint(needResponsive);
204209

205210
const currentBreakpoint = computed(() => {
206211
for (let i = 0; i < responsiveArray.length; i += 1) {

0 commit comments

Comments
 (0)