如何给字段添加超级链接,实现打开新页面。

发布于 2022-08-01 20:48:38

如题:
需要对表格里面某些字段实现a标签跳转之类的效果,路过的朋友帮忙解答下,谢谢!

查看更多

关注者
0
被浏览
675
3 个回答
renyi
renyi 2022-08-01
这家伙很懒,什么也没写!

兄弟,我正好也在写这个,加个联系方式交流一下?
wx:woshirebyi

agui
agui 2022-08-02
这家伙很懒,什么也没写!

1、配置rowSlot=true

let crudOption={
  columns:[ 
    { 
      title : '时间',
      key : 'createData',
      type : 'date',
      rowSlot: true
    }
  ]
}

2、d2-crud 下写你的slot template ,slot名称为 column.key+'Slot'。实现超链接,用el-link 标签。

<d2-crud-x>
    <template slot="createDateSlot" slot-scope="scope">
        <el-link href="#">创建时间:{{scope.row['createDate'] | date_timeline('YYYY-MM-DD HH:mm:ss')}}<br/><el-link>
        更新时间:{{scope.row['updateDate'] | date_timeline('YYYY-MM-DD HH:mm:ss')}}<br/>
    </template>
</d2-crud-x>
hongzai
hongzai 认证专家 2022-08-04
life is coding,外包,远程协助,咨询添加微信:H0nGzA1

el-link加插槽

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览