Commit b608a19870a3cc3dc12cdbab8e1074bce0b0d4f8
1 parent
76c4adef
新闻中心
Showing
8 changed files
with
150 additions
and
4 deletions
src/components/commonHeaderFooter/VHeader.vue
src/router/index.js
src/views/news/components/selectTab0.vue
0 → 100644
src/views/news/components/selectTab1.vue
0 → 100644
src/views/news/components/selectTab2.vue
0 → 100644
src/views/news/components/selectTab3.vue
0 → 100644
src/views/news/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div> | |
| 3 | + <commonProduct mainTitle="中兴智能交通" subTitle="构建绿色交通 享受安全便利出行"></commonProduct> | |
| 4 | + <div class="tab-wrapper"> | |
| 5 | + <ul class="tab-main widthCommon"> | |
| 6 | + <li | |
| 7 | + v-for="(item, index) in tabData" | |
| 8 | + :key="item" | |
| 9 | + @click="changeTab(index,item)" | |
| 10 | + :class="{tabActive:currentIndex==index}" | |
| 11 | + >{{item}}</li> | |
| 12 | + </ul> | |
| 13 | + </div> | |
| 14 | + <div class="bread "> | |
| 15 | + <div class=" widthCommon"> | |
| 16 | + 您所在位置: <span class="pointer" @click="$router.push({name:'home'})">首页</span> -> 新闻中心 -> {{name}} | |
| 17 | + </div> | |
| 18 | + </div> | |
| 19 | + <div class="widthCommon"> | |
| 20 | + <keep-alive> | |
| 21 | + <component :is="tabView"></component> | |
| 22 | + </keep-alive> | |
| 23 | + </div> | |
| 24 | + | |
| 25 | + </div> | |
| 26 | +</template> | |
| 27 | + | |
| 28 | +<script> | |
| 29 | +import commonProduct from '@/components/commonBanner' | |
| 30 | +import selectTab0 from './components/selectTab0' | |
| 31 | +import selectTab1 from './components/selectTab1' | |
| 32 | +import selectTab2 from './components/selectTab2' | |
| 33 | +import selectTab3 from './components/selectTab3' | |
| 34 | +export default { | |
| 35 | + name: 'index', | |
| 36 | + components: { | |
| 37 | + commonProduct, selectTab0, selectTab1, selectTab2, selectTab3 | |
| 38 | + }, | |
| 39 | + data(){ | |
| 40 | + return{ | |
| 41 | + tabData:[ | |
| 42 | + '公司要闻','行业动态','技术前沿', '团队活动' | |
| 43 | + ], | |
| 44 | + currentIndex:0, | |
| 45 | + tabView:'selectTab0', | |
| 46 | + name:'公司要闻' | |
| 47 | + } | |
| 48 | + }, | |
| 49 | + methods:{ | |
| 50 | + changeTab:function (index,item) { | |
| 51 | + console.log(index) | |
| 52 | + this.currentIndex = index | |
| 53 | + this.tabView = 'selectTab'+index | |
| 54 | + this.name = item | |
| 55 | + } | |
| 56 | + } | |
| 57 | +} | |
| 58 | +</script> | |
| 59 | + | |
| 60 | +<style scoped lang="scss"> | |
| 61 | + .tab-wrapper{ | |
| 62 | + height:50px; | |
| 63 | + background:rgba(237,237,237,1); | |
| 64 | + /*line-height: 50px;*/ | |
| 65 | + padding-top: 5px; | |
| 66 | + } | |
| 67 | + .tab-main{ | |
| 68 | + padding-left: 100px; | |
| 69 | + height: 45px; | |
| 70 | + line-height: 45px; | |
| 71 | + } | |
| 72 | + .tab-main li{ | |
| 73 | + float: left; | |
| 74 | + margin-right: 50px; | |
| 75 | + width: 125px; | |
| 76 | + | |
| 77 | + border-radius: 5px; | |
| 78 | + color: #333; | |
| 79 | + font-size: 16px; | |
| 80 | + text-align: center; | |
| 81 | + cursor: pointer; | |
| 82 | + } | |
| 83 | + .tabActive{ | |
| 84 | + background: #FFF; | |
| 85 | + } | |
| 86 | +</style> | ... | ... |
src/views/product/index.vue
| ... | ... | @@ -6,14 +6,14 @@ |
| 6 | 6 | <li |
| 7 | 7 | v-for="(item, index) in tabData" |
| 8 | 8 | :key="item" |
| 9 | - @click="changeTab(index)" | |
| 9 | + @click="changeTab(index,item)" | |
| 10 | 10 | :class="{tabActive:currentIndex==index}" |
| 11 | 11 | >{{item}}</li> |
| 12 | 12 | </ul> |
| 13 | 13 | </div> |
| 14 | 14 | <div class="bread"> |
| 15 | 15 | <div class=" widthCommon"> |
| 16 | - 您所在位置: <span class="pointer" @click="$router.push({name:'home'})">首页</span> -> 产品中心 -> 智慧停车 | |
| 16 | + 您所在位置: <span class="pointer" @click="$router.push({name:'home'})">首页</span> -> 产品中心 -> {{name}} | |
| 17 | 17 | </div> |
| 18 | 18 | </div> |
| 19 | 19 | |
| ... | ... | @@ -41,14 +41,16 @@ export default { |
| 41 | 41 | '智慧停车','公安交通','公共交通' |
| 42 | 42 | ], |
| 43 | 43 | currentIndex:0, |
| 44 | - tabView:'selectTab0' | |
| 44 | + tabView:'selectTab0', | |
| 45 | + name:'智慧停车' | |
| 45 | 46 | } |
| 46 | 47 | }, |
| 47 | 48 | methods:{ |
| 48 | - changeTab:function (index) { | |
| 49 | + changeTab:function (index,item) { | |
| 49 | 50 | console.log(index) |
| 50 | 51 | this.currentIndex = index |
| 51 | 52 | this.tabView = 'selectTab'+index |
| 53 | + this.name = item | |
| 52 | 54 | } |
| 53 | 55 | } |
| 54 | 56 | ... | ... |