diff --git a/src/utils/formatter.ts b/src/utils/formatter.ts new file mode 100644 index 00000000..7c6e39ff --- /dev/null +++ b/src/utils/formatter.ts @@ -0,0 +1,12 @@ +import { fenToYuan } from '@/utils' +import { TableColumnCtx } from 'element-plus' + +// 格式化金额【分转元】 +export const fenToYuanFormat = ( + row: any, + column: TableColumnCtx, + cellValue: any, + index: number +) => { + return `¥${fenToYuan(cellValue)}` +} diff --git a/src/views/mall/trade/brokerage/user/index.vue b/src/views/mall/trade/brokerage/user/index.vue index f2459e64..db59c52d 100644 --- a/src/views/mall/trade/brokerage/user/index.vue +++ b/src/views/mall/trade/brokerage/user/index.vue @@ -73,15 +73,29 @@ align="center" prop="brokerageOrderPrice" min-width="110px" + :formatter="fenToYuanFormat" + /> + - - +