Skip to content

Commit

Permalink
Optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
tangllty committed Jul 4, 2024
1 parent be93e88 commit d77ea90
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
8 changes: 1 addition & 7 deletions src/views/form/designer/FormPanel/NestedForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@
<el-icon v-if="activeItem === component" class="drag-handler">
<Rank />
</el-icon>
<NestedForm
v-if="component.element === 'el-row' && component.children"
v-model="components[index].children"
v-model:activeItem="activeItem"
class="container"
/>
<RenderForm v-else v-model="components[index]" />
<RenderForm v-model="components[index]" />
</div>
</div>
</template>
Expand Down
4 changes: 1 addition & 3 deletions src/views/form/designer/FormPanel/RenderForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
:class="{ 'active-item': activeItem === item }"
@click="handleActiveItem(item, $event)"
>
<el-icon v-if="activeItem === item" class="drag-handler">
<Rank />
</el-icon>
<NestedForm v-model="item.children" v-model:activeItem="activeItem" />
</el-col>
</el-row>
Expand Down Expand Up @@ -63,6 +60,7 @@ const handleActiveItem = (item: Component, event: MouseEvent | null = null) => {
@import './index.scss';
.el-row, .el-col {
min-height: 50px;
border: 1px dashed #336699;
}
Expand Down

0 comments on commit d77ea90

Please sign in to comment.