import { timestampToTime } from '@/utils/dateUtil';
import { h } from 'vue';

export const columns = [
  {
    title: '公告标题',
    key: 'title',
    width: 200,
  },
  {
    title: '公告内容',
    key: 'content',
    width: 460,
    render(rows) {
      return h('p', { id: 'app' }, [
        h('div', {
          innerHTML: '<div style="white-space: pre-wrap">' + rows.content + '</div>',
        }),
      ]);
    },
  },
  {
    title: '创建时间',
    key: 'created_at',
    render: (rows, _) => {
      return timestampToTime(rows.created_at);
    },
    width: 180,
  },
];
