Skip to content

Commit

Permalink
perf: from
Browse files Browse the repository at this point in the history
  • Loading branch information
jsxiaosi committed Jan 20, 2022
1 parent 49c173f commit 2aca6aa
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/components/Form/src/components/FormItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,23 @@
};
function renderComponent() {
// const Comp = componentMap.get(formItem.component) as ReturnType<typeof defineComponent>;
const Comp = resolveComponent(formItem.component) as ReturnType<typeof defineComponent>;
if (elComponentItem[formItem.component]) {
const childerCompName = elComponentItem[formItem.component];
if (childerCompName) {
return (
<Comp v-model={formModel[formItem.prop]} {...formItem.props}>
{childrenComponent()}
{childrenComponent(childerCompName)}
</Comp>
);
} else {
return <Comp v-model={formModel[formItem.prop]} {...formItem.props} />;
}
}
function childrenComponent() {
function childrenComponent(compName: string) {
if (formItem.childrenComponent) {
const { options } = formItem.childrenComponent;
const compName = elComponentItem[formItem.component];
// const Comp = componentMap.get(compName) as ReturnType<typeof defineComponent>;
const Comp = resolveComponent(compName) as ReturnType<typeof defineComponent>;
return (
<>
{options?.map((res) => (
Expand Down

0 comments on commit 2aca6aa

Please sign in to comment.