@@ -17,6 +17,7 @@ import useConfigInject from '../_util/hooks/useConfigInject';
17
17
import useBreakpoint from '../_util/hooks/useBreakpoint' ;
18
18
import type { Breakpoint } from '../_util/responsiveObserve' ;
19
19
import { responsiveArray } from '../_util/responsiveObserve' ;
20
+ import eagerComputed from '../_util/eagerComputed' ;
20
21
21
22
export { ListItemProps } from './Item' ;
22
23
export type { ListItemMetaProps } from './ItemMeta' ;
@@ -43,7 +44,7 @@ export const listProps = () => ({
43
44
bordered : PropTypes . looseBool ,
44
45
dataSource : PropTypes . array ,
45
46
extra : PropTypes . any ,
46
- grid : { type : Object as PropType < ListGridType > , default : undefined } ,
47
+ grid : { type : Object as PropType < ListGridType > , default : undefined as ListGridType } ,
47
48
itemLayout : String as PropType < ListItemLayout > ,
48
49
loading : {
49
50
type : [ Boolean , Object ] as PropType < boolean | ( SpinProps & HTMLAttributes ) > ,
@@ -200,14 +201,9 @@ const List = defineComponent({
200
201
return dd ;
201
202
} ) ;
202
203
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 ( ) ;
209
205
210
- const currentBreakpoint = computed ( ( ) => {
206
+ const currentBreakpoint = eagerComputed ( ( ) => {
211
207
for ( let i = 0 ; i < responsiveArray . length ; i += 1 ) {
212
208
const breakpoint : Breakpoint = responsiveArray [ i ] ;
213
209
if ( screens . value [ breakpoint ] ) {
0 commit comments