鍍金池/ 問答/HTML/ v-for循環(huán)怎么展示tab下面不同的內(nèi)容?

v-for循環(huán)怎么展示tab下面不同的內(nèi)容?

我現(xiàn)在有一個tab切換 上面的標題是發(fā)請求回來的數(shù)據(jù)

<ul id="myTab" class="nav nav-tabs ul-menu">

<li 
v-for="(item,index) in lanmu" 
:class="{active:index == num}"
 @click="tab(index,item.category_id)">{{item.category_name}}</li>

</ul>

clipboard.png
下面是切換是發(fā)請求回來的數(shù)據(jù)

clipboard.png
第一個數(shù)據(jù)是分為上面兩塊的
但是后面的tab切換頁就只有下面這種樣式

clipboard.png
<div id="myTabContent" class="tab-content">

            <div class="tabCon">
                    <div v-for="(item) in hotzixun" class="hotzixun">
                          <div class="con" v-show='item.category_id!=1'>
                            <h4><router-link to="/newinfo" class="goinfo">{{item.news_title}}</router-link></h4>
                            <div class="row">
                                <div class="col-xs-4 col-md-4 img"><img @click='goinfo' class="zx img-responsive" v-bind:src="item.cover" alt=""></div>
                                <div class="col-xs-8 col-md-7 tag">
                                   <span v-for="(item, index) in tags" :key="index">
                                       {{item.tag_name}}
                                   </span>
                                                
                                </div>
                            </div>
                        </div>
                      </div>
                      <!-- <div>
                        <img class="er-90 img-responsive" src="../assets/img/er-90.jpg" alt="">
                      </div> -->
                      <div v-for="(item) in liveList" class="hot-zixun">
                        <essence v-bind:src="item.cover" v-bind:tx="item.tx" v-bind:n='item.n' v-bind:h2='item.h2' v-bind:count='item.count' v-bind:data='item.data'
                          v-bind:tag='item.tag'></essence>
                      </div>
                      
                </div>



回答
編輯回答
陪我終

提問,首先要描述清楚問題,其次需要提供完成的代碼或者demo,涉及數(shù)據(jù)的需要提供數(shù)據(jù);

你的問題只要代碼,并沒有數(shù)據(jù),無從分析你的問題。

但是可以推測你描述的問題應該是數(shù)據(jù)引起的,檢查下你的數(shù)據(jù)是否符合判斷條件v-show='item.category_id!=1' 又或者hotzixun的數(shù)組是否為空

2017年5月5日 14:44