Skip to content

Commit 757f10c

Browse files
committed
【功能优化】现在每次点击装修组件都刷新右侧属性窗口
1 parent 19789fa commit 757f10c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/components/DiyEditor/components/ComponentContainer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
...style
66
}"
77
>
8-
<component :is="component.id" :property="component.property" :component="component" />
8+
<component :is="component.id" :property="component.property" />
99
</div>
1010
<div class="component-wrap">
1111
<!-- 左侧:组件名(悬浮的小贴条) -->

src/components/DiyEditor/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@
151151
class="m-[calc(0px-var(--el-card-padding))]"
152152
view-class="p-[var(--el-card-padding)] p-b-[calc(var(--el-card-padding)+var(--el-card-padding))] property"
153153
>
154+
<!--这里的 key 使用时间戳是为了保证每次点击组件都进行刷新-->
154155
<component
155-
:key="selectedComponent?.uid || selectedComponent?.id"
156+
:key="selectedComponent?.uid || selectedComponent?.id + new Date().getTime() || new Date().getTime().toString()"
156157
:is="selectedComponent?.id + 'Property'"
157158
v-model="selectedComponent.property"
158159
/>

0 commit comments

Comments
 (0)