|
|
<template>
|
|
|
<div class="tab-block">
|
|
|
<div v-for="(tab, index) in tabList" :key="index" :ref="'tab-item' + index" class="tab-item" :class="{active: index == activeIndex}" @click="changeType(index)">
|
|
|
<div v-for="(tab, index) in tabList"
|
|
|
:key="index" :ref="'tab-item' + index"
|
|
|
class="tab-item"
|
|
|
:class="{active: index == activeIndex}"
|
|
|
@click="changeType(index)">
|
|
|
<div class="name">{{tab.name}}</div>
|
|
|
<div v-if="index == statusBlockIndex" ref="statusBlock" class="tab-status-block" :style="statusBlockStyle"></div>
|
|
|
</div>
|
...
|
...
|
@@ -19,8 +23,8 @@ export default { |
|
|
},
|
|
|
data() {
|
|
|
let tabList = [
|
|
|
{name: '最新', type: 2},
|
|
|
{name: '热门', type: 1},
|
|
|
{name: '最新', type: 2},
|
|
|
];
|
|
|
|
|
|
let index = Math.max(findIndex(tabList, {type: this.activeType}), 0);
|
...
|
...
|
|