Skip to content

CondorGridItem

CondorGridItem 是 CondorGrid 的子项组件,用于控制每个子项在网格中的列宽和偏移量。支持在不同断点下设置不同的响应式布局。

组件 Props

参数名类型默认值说明
spannumber1默认占据的列数
offsetnumber0默认列偏移
suffixbooleanfalse是否固定在行尾
xsCondor.Grid.Responsiveundefinedxs 断点下的配置(<768px)
smCondor.Grid.Responsiveundefinedsm 断点下的配置(768px-992px)
mdCondor.Grid.Responsiveundefinedmd 断点下的配置(992px-1200px)
lgCondor.Grid.Responsiveundefinedlg 断点下的配置(1200px-1920px)
xlCondor.Grid.Responsiveundefinedxl 断点下的配置(>=1920px)

响应式对象 Responsive 包含 spanoffset 属性,断点值优先级高于默认值。

基本用法

vue
<template>
  <CondorGrid :cols="4" :gap="12">
    <CondorGridItem :span="2">
      <NInput placeholder="半行宽度" />
    </CondorGridItem>
    <CondorGridItem :span="2">
      <NInput placeholder="半行宽度" />
    </CondorGridItem>
    <CondorGridItem :span="1" :md="{ span: 2 }">
      <!-- 中等屏幕占2列,默认占1列 -->
      <NInput placeholder="响应式宽度" />
    </CondorGridItem>
    <CondorGridItem suffix>
      <!-- 固定在行尾,适合放搜索、重置按钮 -->
      <NButton type="primary">搜索</NButton>
    </CondorGridItem>
  </CondorGrid>
</template>