Vue class style binding problem includes ()

template Code

            <template v-for="item in myList" ><!-- -->
              <ul>
                <span class="span_i"><i></i>{{item.CatName}}</span>
                <li v-for="item1 in item.GameList" :key="item.Id" @click="check_show(item1)" :class="includes(item1)">
                  {{item1.Name}}
                </li>
              </ul>
            </template>

class style function

    includes(item1){
      if (this.selectGame.includes(item1)){
        return "on"
      }else{
        return ""
      }
    },
    //
    check_show(item1) {
      const index1 = this.selectGame.indexOf(item1);
      // let aa = { idName:item.Id,nameId:item.Name}
      if(index1 > -1 ){
        this.selectGame.splice(index1, 1)
      }else if(this.selectGame.length < 10){
        this.selectGame.push(item1);
      }
    },

the problem I have now is how to save this state. After refreshing the page, the "on" on the li will be reset, and even if there is data in the selectGame, it will not display "on"

.
Aug.22,2021

item1 is an object, and selectGame is an array of objects. Although it looks like item1 is in selectGame, includes () always returns false with a different address.

<div :class="JSON.stringify(selectGame).indexOf(JSON.stringify(item1)) > -1 ? 'on' : ''"></div>
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-1b33b85-2bec5.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-1b33b85-2bec5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?