iview实现table里面每行数据的跳转

编程入门 行业动态 更新时间:2024-10-23 03:31:43

iview实现table里面每行数据的<a href=https://www.elefans.com/category/jswz/34/1769274.html style=跳转"/>

iview实现table里面每行数据的跳转

我的需求是跳转到第三方网站,看官方是写了如何跳转站内路由,不符合我的要求,在csdn发现了一篇文章,我贴一下代码

 

<template><Table border :columns="ReportColumns" :data="ReportData"><template #name="{ row }"><strong>{{ row.name }}</strong></template><template #action="{ row, index }"><!--                                        <a href="/" target="_blank">view</a>-->
<!--                                        <Button type="primary" size="small" style="margin-right: 5px"  target="_blank" >View</Button>--><Button type="error" size="small" @click="remove(index)">Delete</Button></template></Table></template>
 data(){return{ReportColumns:[{title: '生成时间',key: 'createTime',width: 220},{title: '生成用户',key: 'creator',width: 200},{title:'报告地址',key:'reportUrl',width: 800,render: (h, params) => {return h('span',{domProps: {innerHTML: "<a href='" + params.row.reportUrl + "' target='_blank'>" + params.row.reportUrl + '</a>'}})}},{title: '操作',slot: 'action',}],

后端接口报文格式

{"ret": true,"code": 0,"msg": "查询成功","content": [{"id": 522,"reportId": 2561,"creator": "李朝阳","createTime": "2023-11-03 12:05:00","reportUrl":"http://192.168.0.1:1111/view/project/5f1e8e97b6e123455555" },{"id": 523,"reportId": 2562,"creator": "白克玲","createTime": "2023-10-03 11:25:00","reportUrl":""}]
}

原贴地址

iview table实现通过render实现点击跳转到相应的网址_iview页面跳转-CSDN博客

更多推荐

iview实现table里面每行数据的跳转

本文发布于:2023-11-15 20:54:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1606186.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:跳转   数据   iview   table

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!