Commit 9a84e522 by caoyanzhi

限制最后一个标签框不能被删除

parent eb4d4b4d
......@@ -8,6 +8,7 @@
:tagsGroupIndex="index"
:tagsRelation="tagsGroupRelation[index]"
:showAddMenu="showAddMenu"
:show-del-menu="selectedTagsData.length > 1"
:active="activeTagsGroupIndex === index"
@addTags="addTags"
@delTags="delTags"
......
......@@ -2,7 +2,7 @@
<div class="w-427 border-box">
<div :class="['tags-group', { 'tags-group--active': active }]" @click="checkTagsGroup">
<!--右上角的下拉菜单-->
<el-dropdown class="tags-group__dropdown" placement="bottom-end">
<el-dropdown class="tags-group__dropdown" placement="bottom-end" v-if="showAddMenu || showDelMenu">
<el-popover width="200" placement="top" v-model="showDelPop" trigger="manual">
<p class="m-b-20">确认删除输入框及内部所有标签?</p>
<div class="text-right">
......@@ -13,7 +13,7 @@
</el-popover>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="showAddMenu" @click.native="addTags">添加标签</el-dropdown-item>
<el-dropdown-item @click.native="showDelPop = true">删除</el-dropdown-item>
<el-dropdown-item v-if="showDelMenu" @click.native="showDelPop = true">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!--展示选中的标签-->
......@@ -75,6 +75,8 @@ export default {
tagsGroupIndex: Number,
// 下拉菜单是否显示"添加标签"菜单项
showAddMenu: Boolean,
// 下拉菜单是否显示"删除"菜单项
showDelMenu: Boolean,
// 标签组是否选中
active: Boolean
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment