Commit c315a10f by caoyanzhi

可选标签组数量上限为5

parent d99ef50c
......@@ -4,7 +4,7 @@
v-for="(item, index) in selectedTagsData"
:key="item"
:tagsData="item"
:showTagsRelation="(index === 0 && selectedTagsData.length > 1) || (index === 1 && selectedTagsData.length > 2)"
:showTagsRelation="index != selectedTagsData.length - 1"
:tagsGroupIndex="index"
:tagsRelation="tagsGroupRelation[index]"
:showAddMenu="showAddMenu"
......@@ -18,7 +18,7 @@
@checkTagsGroup="checkTagsGroup"
@dragTag="dragTag"
/>
<el-button class="m-t-10 w-400 el-icon-plus color-blue add-group-btn" v-show="selectedTagsData.length < 3" @click="addTagsGroup">
<el-button class="m-t-10 w-400 el-icon-plus color-blue add-group-btn" v-show="selectedTagsData.length < group" @click="addTagsGroup">
&nbsp;&nbsp;添加
</el-button>
</div>
......@@ -57,6 +57,12 @@ export default {
default: false
}
},
data() {
return {
// 分组数量
group: 5
}
},
components: {
tagsGroup
},
......@@ -70,7 +76,7 @@ export default {
},
// 添加一个标签组,最多只能有3个标签组
addTagsGroup() {
if (this.selectedTagsData.length < 3) {
if (this.selectedTagsData.length < this.group) {
this.selectedTagsData.push([]);
this.selectedTagsData.length > 1 && this.tagsGroupRelation.push('or');
}
......
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