columns.ts 624 B

123456789101112131415161718192021222324252627282930
  1. import { timestampToTime } from '@/utils/dateUtil';
  2. import { h } from 'vue';
  3. export const columns = [
  4. {
  5. title: '公告标题',
  6. key: 'title',
  7. width: 200,
  8. },
  9. {
  10. title: '公告内容',
  11. key: 'content',
  12. width: 460,
  13. render(rows) {
  14. return h('p', { id: 'app' }, [
  15. h('div', {
  16. innerHTML: '<div style="white-space: pre-wrap">' + rows.content + '</div>',
  17. }),
  18. ]);
  19. },
  20. },
  21. {
  22. title: '创建时间',
  23. key: 'created_at',
  24. render: (rows, _) => {
  25. return timestampToTime(rows.created_at);
  26. },
  27. width: 180,
  28. },
  29. ];