|
@@ -168,13 +168,19 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
selectRightTag(tag) {
|
|
|
- let tmpArr = [];
|
|
|
+ /*let tmpArr = [];
|
|
|
tmpArr.push(tag);
|
|
|
if (this.selectRightTagsList.length > 0 && tag.id == this.selectRightTagsList[0].id) {
|
|
|
this.selectRightTagsList = this.selectRightTagsList.filter(item => item.id !== tag.id)
|
|
|
}else{
|
|
|
this.selectRightTagsList = tmpArr;
|
|
|
- }
|
|
|
+ }*/
|
|
|
+ const hasTag = this.isHasTag(tag, this.selectRightTagsList);
|
|
|
+ if (hasTag) {
|
|
|
+ this.selectRightTagsList = this.selectRightTagsList.filter(item => item.id !== tag.id)
|
|
|
+ } else {
|
|
|
+ this.selectRightTagsList.push(tag);
|
|
|
+ }
|
|
|
},
|
|
|
isHasTag(item, arr) {
|
|
|
for ( let i = 0; i <arr.length; i++) {
|