猿问

vue v-for 获取api数据 需要在每个分类数据前加“不限制”

1.获取的数据


需要在 typeList,gradeList,glossList, 数据前添加“不限制”

效果如下图


  <div class="tab-bg">

    <div class="tab-nav" v-for="(item,index) in tabs" :key="index" :class="{active:index == num}" @click="tab(index)">{{item}}</div>

  </div>

  <div class="tab-content" v-for='(itemCon,index) in tabContents' :key="index" v-show=" index == num " >

    <div class="tab-content-param" @click="clickText1($event)">不限制</div>

    <div class="tab-content-param" v-if="num == 0" v-for='(item,index) in filter.typeList' :key="index">{{item}}</div>

    <div class="tab-content-param" v-if="num == 1" v-for='(item,index) in filter.fineAndPoreVoList' :key="index">{{item}}</div>

    <div class="tab-content-param" v-if="num == 2" v-for='(item,index) in filter.glossList' :key="index">{{item}}</div>

    <div class="tab-content-param" v-if="num == 3" v-for='(item,index) in filter.gradeList' :key="index">{{item}}</div>

  </div>


炎炎设计
浏览 706回答 2
2回答

qq_花开花谢_0

接口获取数据后,你对数据处理下啊,直接把 "不限制" unshift 到 typeList 数组里,然后你再进行渲染不就行吗

天涯尽头无女友

请描述清楚问题
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答