Vant Tab tab event custom parameters

< van-tabs VMI model = "active" animated @ click= "onClick" >

        <van-tab v-for="(item,index) in dome" :title="item.test" :key="index"  ></van-tab>

< / van-tabs >

The tabs event parameter in

vant is a fixed index

here is what I want

< van-tabs VMI model = "active" animated >

        <van-tab v-for="(item,index) in dome" @click="onClick(item.id)" :title="item.test" :key="index"  ></van-tab>

< / van-tabs >
dome: [

    {
      id:1,
      test:"a",
    },
     {
      id:2,
      test:"b",
    },
     {
      id:3,
      test:"c",
    },
     {
      id:4,
      test:"d",
    },
 ]




 
 
 
May.05,2022

use the title of the title slot custom tab, and then the click event is placed on the custom title. The item passed in contains all the information you want

<van-tabs v-model="active">
  <van-tab v-for="(item,index) in tabs">
    <div class="tab-title" slot="title" @click="onClick(item)">{{ item.title }}</div>
    <div class="tab-content">{{ item.content }}</div>
  </van-tab>
</van-tabs>
tabs: [
    {
    id: '1',
    title: '',
    content: ''
  },
  {
    id: '2',
    title: '',
    content: ''
  }
]
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-1ead805-46bdf.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-1ead805-46bdf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?