Deduplication of vue array

the effect I want to achieve is to click on the left navigation and open the right tab. I maintain a piece of data here. If I click repeatedly, I will remove the repetition and solve it.
is how to repeat. Do not show
clipboard.png

clipboard.png

what you click repeatedly.
export default {
  name: "index",
  data:function(){ 
    return {
            msg:"hi",
            mainNav:[],
            navArr:[]
    }
    },
    mounted:function(){
        if(this.mainNav == ""){
            this.$router.push("/mean/home");
        }
        // console.log(this.navArr);
    },
    methods:{
        showNav:function(name){
            this.navArr.push(name);
            this.mainNav = this.navArr;
        }
    },
  components:{
    leftBar,
    top,
    meanBody
  }
};
Oct.14,2021

1. Add a showFlag attribute to each piece of data in the navArr array in the left navigation bar
2. The right tab bar determines whether
3 is displayed according to the showFlag status. The left tab bar toggles the status of showFlag by clicking on the event


this.navArr [j] .indexOf (name) >-1


showNav(name){
    let mu = this.navArr.find((n) => n.name == name.name);
    if(mu){
        console.log('..')
        return;
    }else{
        this.navArr.push(name);
    }
}

listen for routes

$route(newValue, oldValue){
    this.setTags(newValue);
}

set labels

setTags(route){
    const isExist = this.tagsList.some(item => {
        return item.path === route.path;
    })
    !isExist && this.tagsList.push({
        title: route.meta.title,
        path: route.path
    })
},
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e36802-443cc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e36802-443cc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?