在iview的table中使用模板

在iview的table中使用模板

复制代码
 <Table
          border
          :no-data-text="nodatatxt"
          :loading="loadingStatus.tableLoading"
          stripe
          :columns="columns1"
          :data="data1"
          :height="tableHeight"
          ref="multipleTable"
        >
          <template slot-scope="{ row, index }" slot="zhuangtai">
            <i-switch @on-change="change($event, row)" :value="row.releaseStatus" />
          </template>
          <template slot-scope="{ row, index }" slot="tupian">
            <img class="img" :src="row.commodityThumbnail | mypic" alt="" />
          </template>
          <template slot-scope="{ row, index }" slot="dataSetInfo">
            <div class="sanhang" :title="row.dataSetInfo">
              {{row.dataSetInfo}}
            </div>
          </template>
          
          <template slot-scope="{ row, index }" slot="index">{{
            setIndex(row, 1, 1, index)
          }}</template>
          <template slot-scope="{ row, index }" slot="action">
            <a
              type="primary"
              size="small"
              style="margin-right: 15px"
              @click.prevent.stop="editDialog(row)"
              >修改</a
            >
            <a
              type="primary"
              size="small"
              style="margin-right: 15px"
              @click.prevent.stop="viewDetail(row)"
              >详情页预览</a
            >
            <Poptip
              :transfer="true"
              confirm
              title="确定要删除这条记录吗?"
              @on-ok="ok(row)"
              @on-cancel="cancel"
            >
              <a class="error" size="small">删除</a>
            </Poptip>
          </template>
          <div slot="loading">
            <div style="height: 10px; width: 200px">
              <Progress></Progress>
            </div>
          </div>
        </Table>
复制代码

代码部分

复制代码
      columns1: [
        {
          title: '商品ID',
          key: 'id',
          minWidth: 180,
          fixed: 'left',
        },
        {
          title: '序号',
          slot: 'index',
          minWidth: 80,
        },
        {
          title: '商品名称',
          key: 'commodityName',
          minWidth: 160,
        },
        {
          title: '数据集简介',
          slot: 'dataSetInfo',
          minWidth: 300,
        },
        {
          title: '图片',
          slot: 'tupian',
          minWidth: 160,
          align: 'center',
        },
        {
          title: '商品数量',
          key: 'commodityCount',
          minWidth: 180,
        },

        {
          title: '影像模态',
          key: 'dep',
          minWidth: 160,
        },
        {
          title: '数据格式',
          key: 'dataFormat',
          minWidth: 160,
        },

        {
          title: '发布状态',
          slot: 'zhuangtai',
          key: 'counter',
          minWidth: 180,
        },
        {
          title: '时间',
          key: 'pushDate',
          minWidth: 180,
        },

        {
          title: '操作',
          slot: 'action',
          minWidth: 230,
          align: 'center',
          fixed: 'right',
        },
      ],
复制代码

 

posted on   漫思  阅读(1111)  评论(0编辑  收藏  举报

编辑推荐:
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· NetPad:一个.NET开源、跨平台的C#编辑器
· 面试官:你是如何进行SQL调优的?
历史上的今天:
2019-11-02 带你认识各种常见线路接口
2019-11-02 multer 文件后缀名
2019-11-02 multer 基础教程(英文版)
2019-11-02 multer 基础教程(中文版)
2019-11-02 Nodejs进阶:基于express+multer的文件上传

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示