首页 > 其他分享 >vue 使用ant design vue组件实现表格操作

vue 使用ant design vue组件实现表格操作

时间:2022-11-17 09:33:52浏览次数:65  
标签:vue return 表格 text ant 点击 design columns

vue 使用ant design vue组件实现点击表格数据弹窗

写在columns数组的对象里面

customRender: (text, record, index) => {
        if (index === this.list.length - 1) { //此列的最后一行的数据不做事件
               return (<span>{text}</span>) //只看数据
         } else {
               return (<a onclick={() => { this.caseList(record, '诉前保全') }}>{{ text }}</a>)//做点击事件并且带有此列的标题(诉前保全)和点击所在的整行数据。
             }

点击事件:

customRender: (text, record) => {
            return (<a onclick={() => { this.caseList(record, '旧存') }}>{{ text }}</a>)
          }

表格:具体看UI库:https://www.antdv.com/components/table-cn/

<Table
      class="enter-X"
      :row-key="(record,index)=>{return index}"
      :columns="columns"
      :scroll="{x: 1400}"
      :data-source="list"
      :loading="loading"
      :pagination="false"
    >
      <!-- <div slot="data" slot-scope="text, record">
        <a @click="caseList(record,text)">{{ text }}</a>
      </div> -->
    </Table>

columns的构造决定表头的样式

代码

表格折叠

 

 

 @expand="expand"(折叠表格的折叠点击事件)

<Table
      class="enter-X"
      :row-key="(record,index)=>{return index}"
      :columns="columns"
      bordered
      :scroll="{x: 1400}"
      :data-source="list"
      :loading="loading"
      :pagination="false"
      @expand="expand"//点击事件
    />

 

标签:vue,return,表格,text,ant,点击,design,columns
From: https://www.cnblogs.com/cwt981105/p/16898335.html

相关文章

  • vue2中请求函数防抖处理
    ......
  • 图解ReentrantLock底层公平锁和非公平锁实现原理
    ......
  • Vue和Vue3在VS中的插件
     Vue的插件vetur vetur和Vue3插件VuelanguageFeature冲突,只能用一个   Vue3的插件volarVuelanguageFeature和Vue插件Vetur冲突,只能用一个 ......
  • Vue3(Mitt)
     Vue3+vite+Ts+pinia+实战+源码+全栈_哔哩哔哩_bilibili视频教程在vue3中$on,$off和$once实例方法已被移除,组件实例不再实现事件触发接口,因此大家熟悉的E......
  • 手动实现 vue3 [ reactive, computed, watch ]
    一、vue.js1importreactivefrom"./reactive";2importWatcherfrom"./Watcher";3importcomputedfrom"./computed";4importwatchfrom"./watch";56ex......
  • vue使用Luckysheet插件实现导入导出
    Luckysheet开发的excel导入导出库-Luckyexcel(opensnewwindow)已经实现了excel导入功能(目前只支持xslx文件);支持多sheet更新导出边框问题更新导出类型不同时样式使用方......
  • Vue 中组件的使用
    一、局部组件的使用。渲染组件-父使用子组件。1、声子:创建子组件(对象)。//局部组件:声子挂子用子varVheader={template:`......
  • vue-router的使用
    安装npminstallvue-router--save路由映射配置创建router文件夹新建index.js vue实例中挂载router  使用路由<router-link></router-link><rou......
  • pydantic初探
    数据校验的的专业工作请看pydantic1frompydanticimportBaseModel,conint,ValidationError234classNumVerify(BaseModel):5#限定范围6ex......
  • 问题记录-前端开发避坑(7)--vue 原生h5开发及基础组件开发
    问题1问题描述与分析执行vueRouter的编程式导航时,报错:vuerouterTypeError:onCompleteisnotafunction检查发现是参数格式不对。这里使用了对象语法,而我错把qu......