vue+Ant 表单内嵌时间选择框(插槽)

columns里使用插槽

{
 columns: [
          {
            title: '序号',
            dataIndex: '',
            key: 'rowIndex',
            width: 70,
            align: 'center',
            customRender: function (t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '时间',
            width: 120,
            align: 'center',
            dataIndex: 'time',
            scopedSlots: {
              customRender: 'time'
            }
          },    
        ],

新建里使用插槽,内嵌时间控件

    <template>
    <a-modal
      :title="title"
      :width="width"
      :visible="visible"
      :confirmLoading="confirmLoading"
      @ok="handleOk"
      @cancel="handleCancel"
      cancelText="关闭"
    >
      <a-card :bordered="false">
      <!-- 查询区域 -->
      <div class="tableForm">
      <a-table
          ref="table"
          size="middle"
          bordered
          rowKey="id"
          :columns="columns"
          :dataSource="dataSource"
          :rowSelection ="rowSelection"
          :pagination="ipagination"
          :loading="loading"
          :scroll="tableScroll"
          @change="handleTableChange">
          
          <a-form-model
            slot="time"
            slot-scope="text,record,index"
            :ref="record.index"
            :model="record"
            :rules="rules"
            style="width:200px;height:40px"
          >
          <a-form-model-item prop="time">
            <j-date :show-time="true" placeholder="请选择开始日期" class="query-group-cust" date-format="YYYY-MM-DD" v-model="record.time"></j-date>
          </a-form-model-item>
        </a-form-model>
        </a-table>
      </div>
      </a-card>
    </a-modal>
    
  </template>

因为是企业级项目,敏感信息需要打码处理
在这里插入图片描述
选择时间框,可以操作时间控件
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值