SOURCE

console 命令行工具 X clear

                    
>
console
new Vue({
  el:'#app',
  data : {
    tabsParam:['tab1','tab2','tab3'],
    lgfs : ['我是第一个','我的第二个','我是第三个'],
    nowIndex:0
  },
  methods : {
    toggleTab : function (index) {
      this.nowIndex=index;
    },
    toggleLgf : function (lgfindex) {
      index+=1;
      alert("我是"+lgfindex);
    }
  }
})
<div id="app">
  <ul class="tabs">
    <li class="li-tab" v-for="(item, index) in tabsParam" @click="toggleTab(index)" :class="{active:index==nowIndex}">{{item}}</li>
    
  </ul>
  <div v-for="(lgf, lgfindex) in lgfs" @click="toggleLgf(lgfindex)">{{lgf}}</div>
  

</div>
.tabs {
  width: 200px;
  height: 200px;
  border:1px solid #ddd;
  
}
.active {
  background:#f0f;
}
.li-tab {
  font-size:20px;
}