Zimo 3 日 前
コミット
b1d74ffb63
1 ファイル変更2 行追加1 行削除
  1. 2 1
      src/components/ZmTable/ZmTableColumn.vue

+ 2 - 1
src/components/ZmTable/ZmTableColumn.vue

@@ -9,6 +9,7 @@ interface Props extends /* @vue-ignore */ Partial<Omit<TableColumnCtx<T>, 'prop'
   zmSortable?: boolean
   zmFilterable?: boolean
   filterModelValue?: any
+  realValue?: (value: any) => any
 }
 
 const emits = defineEmits(['update:filterModelValue'])
@@ -89,7 +90,7 @@ const handleSearchClick = () => {
 const calculativeWidth = () => {
   console.log('tableContext.data :>> ', tableContext.data.value)
   const values = tableContext.data.value.map(
-    (item) => props.formatter?.(item[props.prop]) || item[props.prop]
+    (item) => props.realValue?.(item[props.prop]) || item[props.prop]
   )
   console.log('values :>> ', values)
 }