vue antd row col布局中存在select页面 未对齐

当使用Vue Antd的row和col进行页面布局时,如果包含select组件,可能会出现因布局导致的空白间隔。解决这个问题的方法是在row组件上设置属性type为'flex'。

在vue antd使用row、col布局时,若存在select下拉选择框,页面布局中存在空白间隔列。

 需要在row中添加布局类型:type="flex"

<template>
  <div>
    <a-modal :title="title"
             :visible="visible"
             cancelText="关闭"
             okText="确定"
             width="800px"
             @ok="onOk"
             @cancel="onCancel">
      <a-form layout="horizontal" :form="form">
        <div>
          <a-row :gutter="24" type="flex">
            <a-col :span="12" v-for="item in addPageFieldList" :key="item.fieldId" :value="item.value">
              <a-form-item
                  :label="item.fieldName"
                  :labelCol="{span: 5}"
                  :wrapperCol="{span: 18, offset: 1}"
              >
<!--                无关联关系并且不是文件上传,则为input-->
                <a-input v-if="(item.cdFieldRelation == null && item.isFileupload != '0' )"
                         :placeholder="'请输入'+item.fieldName" v-decorator="item.vDecorator"/>
<!--                有关联关系,下来选择-->
                <a-select v-else-if="item.cdFieldRelation"
                          placeholder="请选择"
                          style="display: block;" v-decorator="item.vDecorator"
                          :mode="(item.cdFieldRelation.relationMode == 0)?'default':'multiple'"
                >
                  <a-select-option
                      v-for="dicValue in item.dicListData"
                      :value="dicValue.dicCode"
                      :key="dicValue.dicId"
                  >
                    {{ dicValue.dicName}}
                  </a-select-option>
                </a-select>
<!--                文件上传-->
                <a-upload :name="item.fieldCode" v-if="(item.isFileupload == '0')"
                          action="/api/crud/cdFile/uploadFile"
                          :data="{name:item.fieldCode}"
                          :default-file-list="item.fileList"
                          @change="fileUploadChange($event,item.fieldCode)"
                          :remove="handleFileRemove"
                  >
                  <Button>
                    <a-icon type="upload"/>上传
                  </Button>
                </a-upload>
              </a-form-item>
            </a-col>
          </a-row>
        </div>
      </a-form>
    </a-modal>
  </div>
</template>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值