How to pass parameters in the element @ click created by v-for in vuejs

I originally wanted to get the value in the list array in typelist by traversing, and then it.type can get the value if index can"t get the value. Did I make a mistake in writing?

     //
         typelist:[ 
          {name:"",
            list:[
              {isShow:false,name:"",type:1},
              {isShow:false,name:"",type:2},
              {isShow:false,name:"",type:3},
              {isShow:false,name:"",type:4},
              {isShow:false,name:"",type:5},
              {isShow:false,name:"",type:0},
            ],
          }
        ],
        //
        <div style="padding: .24rem;">
          <yd-cell-group v-for="item in typelist" >
        <yd-cell-item >
          <span slot="left">{{item.name}}</span>    <!-- -->
        </yd-cell-item>
        <div v-for="(it,index) in item.list">
          <yd-button class="tagbuttom" type="primary"  @click.native="colorshow(it.type,index)" :class="{clicks: buttocolor==it.isShow}">{{it.name}}</yd-button>
        </div>
        
       

clipboard.png

Mar.25,2021

the error is reported in method. Post the method code


replace your html with the following

  <div style="padding: .24rem;">
        <yd-cell-group v-for="(item,index) in typelist" :key="index">
          <yd-cell-item>
            <span slot="left">{{item.name}}</span>
            <!-- -->
          </yd-cell-item>
          <div v-for="(it,i) in item.list" :key="i">
            <yd-button class="tagbuttom" type="primary" @click.native="colorshow(it.type,i)" :class="{clicks: buttocolor==it.isShow}">{{it.name}}</yd-button>
          </div>
        </yd-cell-group>
      </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-1b32c75-2be4a.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-1b32c75-2be4a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?