Html 如何在Quasar中向一行项目添加超链接?
我有一个类星体表,其中有5列。在这五列中,我希望第一列有一个指向我从api获取的值的超链接 这是我的blade.php代码-Html 如何在Quasar中向一行项目添加超链接?,html,vuejs2,qtableview,quasar-framework,quasar,Html,Vuejs2,Qtableview,Quasar Framework,Quasar,我有一个类星体表,其中有5列。在这五列中,我希望第一列有一个指向我从api获取的值的超链接 这是我的blade.php代码- colModel:[ {name:'name',index:'name', align:'center', sortable:false, formatter: 'showlink', width:211, cellattr: function (rowId, tv, rawObject, cm, rdata) { return 'style="white-space:
colModel:[
{name:'name',index:'name', align:'center', sortable:false, formatter: 'showlink', width:211, cellattr: function (rowId, tv, rawObject, cm, rdata) { return 'style="white-space: normal;"' }, searchoptions:{sopt:["cn","eq","nc","bw"]}},
{name:'in',index:'in', align:'center', sorttype:'date', datefmt:'Y-m-d H:i:s', searchoptions:{sopt:["cn","eq","nc","bw"]}},
{name:'out',index:'out', align:'center', sortable:true, searchoptions:{sopt:["cn","eq","nc","bw"]}},
{name:'in_comments',index:'in_comments', align:'center', sorttype:'text', width:211, cellattr: function (rowId, tv, rawObject, cm, rdata) { return 'style="white-space: normal;"' }, searchoptions:{sopt:["cn","eq","nc","bw"]}},
{name:'out_comments',index:'out_comments', align:'center', sorttype:'text', width:211, cellattr: function (rowId, tv, rawObject, cm, rdata) { return 'style="white-space: normal;"' }, searchoptions:{sopt:["cn","eq","nc","bw"]}}
]
这是我的Vue代码-
visibleColumns: ['name', 'in', 'out', 'in_comments', 'out_comments'],
columns: [
{ name: 'name', align: 'center', label: 'Name', field: 'name', sortable: true },
{ name: 'in', label: 'In', field: 'in', sortable: true },
{ name: 'out', label: 'Out', field: 'out', sortable: true },
{ name: 'in_comments', label: 'in comments', field: 'in_comments' },
{ name: 'out_comments', label: 'out comments', field: 'out_comments' },
],
名称应使用如下超链接包装-
名字
我可以知道怎样才能做到这一点吗?您也只能自定义一个特定的列。此插槽的语法为
body cell-[name]
,其中[name]
应替换为用作行键的每一行的属性
示例-
<template v-slot:body-cell-name="props">
<q-td :props="props">
<div>
<a href="https://quasar.dev/vue-components/table#QTable-API" />
</div>
</q-td>
</template>