import { h } from 'vue';

export const columns = [
  {
    type: 'selection',
    width: 50,
    fixed: 'left',
    multiple: false,
  },
  {
    title: 'ID',
    key: 'id',
    width: 60,
    fixed: 'left',
  },
  {
    title: '文章标题',
    key: 'title',
    ren(record) {
      return h(
        'a',
        {
          href: 'http://www.baidu.com',
          target: '_blank',
        },
        record.title,
      );
    },
    width: 300,
  },
  {
    title: '文章分类',
    key: 'categoryName',
    width: 100,
  },
  {
    title: '文章状态',
    key: 'status',
    render(record) {
      return h('span', record.status === 1 ? '下架' : '正常');
    },
    width: 100,
  },
  {
    title: '创建人',
    key: 'createUser',
    width: 100,
  },
  {
    title: '创建时间',
    key: 'createTime',
    width: 180,
  },
];
