11import {
22 h ,
3+ Component ,
4+ ComponentOptions ,
35 RenderFunction ,
46 Fragment ,
57 SetupContext ,
68 VNodeChild ,
79 VNodeArrayChildren
810} from 'vue'
911import { NumberOptions , DateTimeOptions } from '../core'
10- import { isString , isPlainObject , isArray } from '../utils'
12+ import { isString , isObject , isArray } from '../utils'
1113import { BaseFormatProps } from './base'
1214
1315export interface FormattableProps < Value , Format > extends BaseFormatProps {
@@ -45,7 +47,7 @@ export function renderFormatter<
4547
4648 if ( isString ( props . format ) ) {
4749 options . key = props . format
48- } else if ( isPlainObject ( props . format ) ) {
50+ } else if ( isObject ( props . format ) ) {
4951 // eslint-disable-next-line @typescript-eslint/no-explicit-any
5052 if ( isString ( ( props . format as any ) . key ) ) {
5153 // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -72,8 +74,11 @@ export function renderFormatter<
7274 children = [ parts ]
7375 }
7476
75- return props . tag
77+ // prettier-ignore
78+ return isString ( props . tag )
7679 ? h ( props . tag , { ...attrs } , children )
77- : h ( Fragment , { ...attrs } , children )
80+ : isObject ( props . tag )
81+ ? h ( props . tag as Component | ComponentOptions , { ...attrs } , children )
82+ : h ( Fragment , { ...attrs } , children )
7883 }
7984}
0 commit comments