Commit 67f94781384260f9b4579a82b992e518420e46d3
Committed by
小小鲁班
1 parent
8929ee3a
[feat] 调整box-model 选中事件
Showing
1 changed file
with
5 additions
and
2 deletions
front-end/h5/src/components/core/editor/right-panel/box-model/index.vue
| ... | ... | @@ -2,7 +2,6 @@ |
| 2 | 2 | <div v-if="editingElement" class="box-model"> |
| 3 | 3 | <div v-if="boxModelPart" class="prompt">设置 {{ boxModelPart }}</div> |
| 4 | 4 | <div v-else>选择 margin/border/padding 进行设置</div> |
| 5 | - <el-color-picker v-if="isEditingBorder" size="small" :value="borderColor" @change="onColorChange"/> | |
| 6 | 5 | <PositionCheckbox label="上" label-key="top" /> |
| 7 | 6 | <div class="middle"> |
| 8 | 7 | <PositionCheckbox label="左" label-key="left" /> |
| ... | ... | @@ -21,6 +20,10 @@ |
| 21 | 20 | <PositionCheckbox label="右" label-key="right" /> |
| 22 | 21 | </div> |
| 23 | 22 | <PositionCheckbox label="下" label-key="bottom" /> |
| 23 | + <template v-if="isEditingBorder"> | |
| 24 | + <div> 设置border-color </div> | |
| 25 | + <el-color-picker size="small" :value="borderColor" @change="onColorChange"/> | |
| 26 | + </template> | |
| 24 | 27 | </div> |
| 25 | 28 | </template> |
| 26 | 29 | |
| ... | ... | @@ -77,7 +80,7 @@ |
| 77 | 80 | } |
| 78 | 81 | // 选中的元素添加上选中的 className |
| 79 | 82 | if (!classList.contains(selectClass)) { |
| 80 | - target.classList.add(selectClass) | |
| 83 | + this.$refs[type].classList.add(selectClass) | |
| 81 | 84 | this.lastSelect = type |
| 82 | 85 | } |
| 83 | 86 | }, | ... | ... |