<template>
    <div class="widthCommon" >
      <commonBanner mainTitle="中兴智能交通" subTitle="构建绿色交通 享受安全便利出行"></commonBanner>
      <div class="tab-wrapper">
        <ul class="tab-main widthCommon">
          <li
            v-for="(item, index) in tabData"
            :key="item"
            @click="changeTab(index,item)"
            :class="{tabActive:currentIndex==index}"
          >{{item}}</li>
        </ul>
      </div>

      <div class="bread ">
        <div class=" widthCommon">
          您所在位置: <span class="pointer" @click="$router.push({name:'home'})">首页</span> -> 经典案例 -> {{name}}
        </div>
      </div>

      <div class="widthCommon">
        <keep-alive>
          <component :is="tabView"></component>
        </keep-alive>
      </div>



    </div>
</template>

<script>
import commonBanner from '@/components/commonBanner'
import selectTab0 from './components/selectTab0'
import selectTab1 from './components/selectTab1'
import selectTab2 from './components/selectTab2'
export default {
  name: 'index',
  components:{
    commonBanner, selectTab0, selectTab1, selectTab2
  },
  data(){
    return{
      tabData:[
        '智慧停车','公安交通','公共交通'
      ],
      currentIndex:0,
      tabView:'selectTab0',
      name:'智慧停车'
    }
  },
  methods:{
    changeTab:function (index,item) {
      console.log(index)
      this.currentIndex = index
      this.tabView = 'selectTab'+index
      this.name = item
    },
    pagePhotoChange:function (pInfo) {
      console.log(pInfo)
    },
  }
}
</script>

<style scoped lang="scss">

</style>
