cosey 0.7.3 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,6 +30,7 @@ export type RendererType = 'text' | 'date' | 'datetime' | 'media' | {
30
30
  } | {
31
31
  type: 'click';
32
32
  props?: Partial<LinkProps>;
33
+ format?: TableColumnProps['format'];
33
34
  onClick?: (params: {
34
35
  row: any;
35
36
  value: any;
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, createVNode, mergeProps, isVNode } from 'vue';
1
+ import { defineComponent, ref, createVNode, mergeProps } from 'vue';
2
2
  import { ElSwitch, ElMessage, ElLink, ElTag } from 'element-plus';
3
3
  import { get } from 'lodash-es';
4
4
  import { LongText as _LongText } from '../../long-text/index.js';
@@ -9,9 +9,6 @@ import { formatToDate, formatToDateTime } from '../../../utils/date.js';
9
9
  import { getVNodeText } from '../../../utils/vue.js';
10
10
  import { toArray } from '../../../utils/array.js';
11
11
 
12
- function _isSlot(s) {
13
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
14
- }
15
12
  const mapRendererColumnProps = {
16
13
  media: {
17
14
  minWidth: 104,
@@ -125,8 +122,8 @@ function renderer({
125
122
  index,
126
123
  column
127
124
  })
128
- }), _isSlot(cellValue) ? cellValue : {
129
- default: () => [cellValue]
125
+ }), {
126
+ default: () => [obj.format ? obj.format(cellValue, row, column, index) : cellValue]
130
127
  });
131
128
  }
132
129
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.7.3",
3
+ "version": "0.7.5",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",