@@ -17,6 +17,7 @@ import useConfigInject from '../_util/hooks/useConfigInject';
1717import useBreakpoint from '../_util/hooks/useBreakpoint' ;
1818import type { Breakpoint } from '../_util/responsiveObserve' ;
1919import { responsiveArray } from '../_util/responsiveObserve' ;
20+ import eagerComputed from '../_util/eagerComputed' ;
2021
2122export { ListItemProps } from './Item' ;
2223export type { ListItemMetaProps } from './ItemMeta' ;
@@ -43,7 +44,7 @@ export const listProps = () => ({
4344 bordered : PropTypes . looseBool ,
4445 dataSource : PropTypes . array ,
4546 extra : PropTypes . any ,
46- grid : { type : Object as PropType < ListGridType > , default : undefined } ,
47+ grid : { type : Object as PropType < ListGridType > , default : undefined as ListGridType } ,
4748 itemLayout : String as PropType < ListItemLayout > ,
4849 loading : {
4950 type : [ Boolean , Object ] as PropType < boolean | ( SpinProps & HTMLAttributes ) > ,
@@ -200,14 +201,9 @@ const List = defineComponent({
200201 return dd ;
201202 } ) ;
202203
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 ) ;
204+ const screens = useBreakpoint ( ) ;
209205
210- const currentBreakpoint = computed ( ( ) => {
206+ const currentBreakpoint = eagerComputed ( ( ) => {
211207 for ( let i = 0 ; i < responsiveArray . length ; i += 1 ) {
212208 const breakpoint : Breakpoint = responsiveArray [ i ] ;
213209 if ( screens . value [ breakpoint ] ) {
0 commit comments