import { computed , toRefs , defineComponent , DefineComponent } from 'vue' ; import { getPrefixCls } from '../_utils/global-config' ; import { BaseGridProps } from './interface' ; displayName version export default defineComponent ( { name : 'BaseGrid' , props : { zh en cols : { type : Number , default : 24 } , zh en rowGap : { type : Number , default : 0 } , zh en colGap : { type : Number , default : 0 } , zh en collapsed : { type : Boolean , default : false } , zh en collapsedRows : { type : Number , default : 1 } } , setup ( props , { slots } ) { const { cols , colGap , rowGap } = toRefs ( props ) ; const prefixCls = getPrefixCls ( 'grid' ) ; const classNames = computed ( ( ) => [ prefixCls ] ) ; const style = computed ( ( ) => [ { 'gap' : `${ rowGap . value }px ${ colGap . value }px` , 'grid-template-columns' : `repeat(${ cols . value }, minmax(0px, 1fr))` } , ] ) ; return ( ) => { return ( < div class = { classNames . value } style = { style . value } > { slots . default ?. ( ) } < /div>); } ; } } ) as DefineComponent < BaseGridProps > ;