The problem of selecting all the select drop-down boxes in vue and ivew projects

when I first select other options and then select all, there should be only all highlights, which is correct at this time. When I choose all first, when I choose others, there will always be all, and there will be no other. Also, it will be executed twice at this time.
Link description

        onChangeGame(a){
          const length=a.slice(0).length;
          if(length>1){
            if(a[length-1]==="-1"){
              console.log("-1")
              this.game_app_key=["-1"]
              return;
            }else{
              if(a[0]==="-1"){
                 this.game_app_key=a.shift();
              }
            }
          }
          console.log(a)
          console.log("")
        }

Apr.29,2021

shift misused

if(a[0]==='-1'){
    // a.shift()a,   
    this.game_app_key=a.shift();    // this.game_app_key-1
   }

the correct method should be

if(a[0]==='-1'){
    a.shift()
    this.game_app_key=a;    // this.game_app_key
   }
Menu