wms-antdvue/.svn/pristine/9f/9fce7d6cf9e22f262d1004919b95e18358567224.svn-base
2024-11-07 16:33:03 +08:00

82 lines
1.4 KiB
Plaintext

import { h } from 'vue';
import { Tag,Avatar } from 'ant-design-vue';
export const columns = [
{
title:'ID',
dataIndex: 'id',
width:100,
fixed:'left'
},
{
title: '文章标题',
dataIndex: 'title',
customRender({ record }) {
return h('a', {
href: 'http://www.baidu.com',
target:"_blank"
},record.title);
},
},
{
title: '文章封面',
dataIndex: 'cover',
key: 'cover',
customRender({ record }) {
return h(Avatar, {
size: 48,
src: record.cover,
shape: 'square',
fit: 'fill',
});
},
width: 100,
},
{
title: '文章分类',
dataIndex: 'categoryName',
},
{
title: '文章作者',
dataIndex: 'author',
},
{
title: '文章状态',
dataIndex: 'status',
customRender({ record }) {
return h(
Tag,
{
color: record.status ==1 ? 'error' : 'success',
},
{
default: () => (record.status ==1 ? '下架' : '正常'),
},
);
},
},
{
title: '点击率',
dataIndex: 'click',
},
{
title: '文章排序',
dataIndex: 'sort',
},
{
title: '创建人',
dataIndex: 'createUser',
},
{
title: '创建时间',
dataIndex: 'createTime',
},
{
title: '操作',
fixed:'right',
dataIndex: 'action',
key: 'action',
width: 200,
},
];