82 lines
1.4 KiB
Plaintext
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,
|
|
},
|
|
];
|