ant-design-vue 中table行 绑定点击事件
目前在学习使用antd中,需求双击表格行显示pdf,在table中给customRow设置行属性<a-tablebordered:rowSelection="rowSelection":columns="columns":dataSource="data"rowKey="id":customRow...
·
目前在学习使用antd中,需求双击表格行显示pdf,在table中给customRow设置行属性
<a-table
bordered
:rowSelection="rowSelection"
:columns="columns"
:dataSource="data"
rowKey="id"
:customRow="Rowclick"
:pagination="pagination"
:scroll="{ y: 520 }"
size="small"
>
<span slot="sex" slot-scope="sex">
{{ sex == 1 ? "男" : sex == 0 ? "女" : "/" }}
</span>
<span slot="status" slot-scope="status">
{{ status == 1 ? "已打印" : "未打印" }}
</span>
</a-table>
methods中
Rowclick(record, index) {
return {
on: {
click: () => {},
dblclick: () => {
console.log(record, index, 2222);
this.showPdf = true;
let url = "demo.pdf";
this.pSrc = "/static/pdf/web/viewer.html?file=" + url;
// window.open("/static/pdf/web/viewer.html?file=" + url);
}
}
};
},
更多推荐
已为社区贡献5条内容
所有评论(0)