Merge pull request #7299 from dataease/pr@dev@feat_text_select_clr_btn

feat(视图-文本下拉组件): 增加清空按钮。#7144
This commit is contained in:
wisonic-s 2023-12-22 18:01:26 +08:00 committed by GitHub
commit af8a8b284c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,12 @@
/>
</v-flex>
<span solt="footer">{{ $t('panel.drag_here') }}</span>
<span slot="footer">{{ $t('panel.drag_here') }}</span>
<i
v-show="element.options.attrs.dragItems.length"
class="el-icon-error clr-btn"
@click="clearItems"
/>
</draggable>
</el-row>
</div>
@ -96,7 +101,10 @@ export default {
},
end2(e) {
},
clearItems() {
this.element.options.attrs.dragItems.splice(0)
this.element.options.attrs.sort = null
},
closeItem(tag) {
const index = tag.index
this.element.options.attrs.dragItems.splice(index, 1)
@ -191,5 +199,12 @@ export default {
.blackTheme .theme-drag {
background-color: var(--MainBG, #fff);
}
.clr-btn {
cursor: pointer;
position: absolute;
right: 10px;
&:hover {
color: #3370ff;
}
}
</style>