vue-admin-core
Version:
A Component Library for Vue 3
1 lines • 1.18 kB
Source Map (JSON)
{"version":3,"file":"resolve-component.mjs","sources":["../../../../../../package/formily/__builtins__/shared/resolve-component.ts"],"sourcesContent":["import { DefineComponent, h, isVNode, toRaw } from \"vue\";\nimport { SlotTypes } from \".\";\n\nexport const resolveComponent = (child?: SlotTypes, props?: Record<string, any>) => {\n if (child) {\n if (typeof child === \"string\" || typeof child === \"number\") {\n return child;\n } else if (typeof child === \"function\") {\n return (child as Function)(props);\n } else if (isVNode(child)) {\n return child;\n } else {\n return h(toRaw(child as DefineComponent), props);\n }\n }\n\n return null;\n};\n"],"names":[],"mappings":";;AAGa,MAAA,gBAAA,GAAmB,CAAC,KAAA,EAAmB,KAAgC,KAAA;AAClF,EAAA,IAAI,KAAO,EAAA;AACT,IAAA,IAAI,OAAO,KAAA,KAAU,QAAY,IAAA,OAAO,UAAU,QAAU,EAAA;AAC1D,MAAO,OAAA,KAAA,CAAA;AAAA,KACT,MAAA,IAAW,OAAO,KAAA,KAAU,UAAY,EAAA;AACtC,MAAA,OAAQ,MAAmB,KAAK,CAAA,CAAA;AAAA,KAClC,MAAA,IAAW,OAAQ,CAAA,KAAK,CAAG,EAAA;AACzB,MAAO,OAAA,KAAA,CAAA;AAAA,KACF,MAAA;AACL,MAAA,OAAO,CAAE,CAAA,KAAA,CAAM,KAAwB,CAAA,EAAG,KAAK,CAAA,CAAA;AAAA,KACjD;AAAA,GACF;AAEA,EAAO,OAAA,IAAA,CAAA;AACT;;;;"}