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>
Menu