Commit 0c75b35cfc1cad34a3c51de61d6b3359dd7d9327
1 parent
9a543af7
经典案例 目录建立
Showing
8 changed files
with
215 additions
and
24 deletions
src/assets/css/commonCss/reset.css
| @@ -182,3 +182,30 @@ table { | @@ -182,3 +182,30 @@ table { | ||
| 182 | background:rgba(238,238,238,1); | 182 | background:rgba(238,238,238,1); |
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | +/*tab切换*/ | ||
| 186 | +.tab-wrapper{ | ||
| 187 | + height:50px; | ||
| 188 | + background:rgba(237,237,237,1); | ||
| 189 | + /*line-height: 50px;*/ | ||
| 190 | + padding-top: 5px; | ||
| 191 | +} | ||
| 192 | +.tab-main{ | ||
| 193 | + padding-left: 100px; | ||
| 194 | + height: 45px; | ||
| 195 | + line-height: 45px; | ||
| 196 | +} | ||
| 197 | +.tab-main li{ | ||
| 198 | + float: left; | ||
| 199 | + margin-right: 50px; | ||
| 200 | + width: 125px; | ||
| 201 | + | ||
| 202 | + border-radius: 5px; | ||
| 203 | + color: #333; | ||
| 204 | + font-size: 16px; | ||
| 205 | + text-align: center; | ||
| 206 | + cursor: pointer; | ||
| 207 | +} | ||
| 208 | +.tabActive{ | ||
| 209 | + background: #FFF; | ||
| 210 | +} | ||
| 211 | + |
src/views/case/components/selectTab0.vue
0 → 100644
src/views/case/components/selectTab1.vue
0 → 100644
src/views/case/components/selectTab2.vue
0 → 100644
src/views/case/index.vue
| 1 | <template> | 1 | <template> |
| 2 | - <div>经典案例</div> | 2 | + <div class="widthCommon" style="margin-bottom: 20px;"> |
| 3 | + <commonBanner mainTitle="中兴智能交通" subTitle="构建绿色交通 享受安全便利出行"></commonBanner> | ||
| 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> | ||
| 3 | </template> | 15 | </template> |
| 4 | 16 | ||
| 5 | <script> | 17 | <script> |
| 18 | +import commonBanner from '@/components/commonBanner' | ||
| 19 | +import selectTab0 from './components/selectTab0' | ||
| 20 | +import selectTab1 from './components/selectTab1' | ||
| 21 | +import selectTab2 from './components/selectTab2' | ||
| 6 | export default { | 22 | export default { |
| 7 | - name: 'index' | 23 | + name: 'index', |
| 24 | + components:{ | ||
| 25 | + commonBanner, selectTab0, selectTab1, selectTab2 | ||
| 26 | + }, | ||
| 27 | + data(){ | ||
| 28 | + return{ | ||
| 29 | + tabData:[ | ||
| 30 | + '公司要闻','行业动态','技术前沿', '团队活动' | ||
| 31 | + ], | ||
| 32 | + currentIndex:0, | ||
| 33 | + tabView:'selectTab0', | ||
| 34 | + name:'公司要闻' | ||
| 35 | + } | ||
| 36 | + }, | ||
| 37 | + methods:{ | ||
| 38 | + changeTab:function (index,item) { | ||
| 39 | + console.log(index) | ||
| 40 | + this.currentIndex = index | ||
| 41 | + this.tabView = 'selectTab'+index | ||
| 42 | + this.name = item | ||
| 43 | + } | ||
| 44 | + } | ||
| 8 | } | 45 | } |
| 9 | </script> | 46 | </script> |
| 10 | 47 |
src/views/news/components/selectTab0.vue
No preview for this file type
src/views/news/index
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 | + | ||
| 50 | +} | ||
| 51 | +</script> | ||
| 52 | + | ||
| 53 | +<style scoped lang="scss"> | ||
| 54 | + .tab-wrapper{ | ||
| 55 | + height:50px; | ||
| 56 | + background:rgba(237,237,237,1); | ||
| 57 | + /*line-height: 50px;*/ | ||
| 58 | + padding-top: 5px; | ||
| 59 | + } | ||
| 60 | + .tab-main{ | ||
| 61 | + padding-left: 100px; | ||
| 62 | + height: 45px; | ||
| 63 | + line-height: 45px; | ||
| 64 | + } | ||
| 65 | + .tab-main li{ | ||
| 66 | + float: left; | ||
| 67 | + margin-right: 50px; | ||
| 68 | + width: 125px; | ||
| 69 | + | ||
| 70 | + border-radius: 5px; | ||
| 71 | + color: #333; | ||
| 72 | + font-size: 16px; | ||
| 73 | + text-align: center; | ||
| 74 | + cursor: pointer; | ||
| 75 | + } | ||
| 76 | + .tabActive{ | ||
| 77 | + background: #FFF; | ||
| 78 | + } | ||
| 79 | +</style> |
src/views/news/index.vue
| 1 | <template> | 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> | 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}} | ||
| 23 | </div> | 17 | </div> |
| 24 | - | ||
| 25 | </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> | 26 | </template> |
| 27 | 27 | ||
| 28 | <script> | 28 | <script> |
| @@ -46,6 +46,14 @@ export default { | @@ -46,6 +46,14 @@ export default { | ||
| 46 | name:'公司要闻' | 46 | name:'公司要闻' |
| 47 | } | 47 | } |
| 48 | }, | 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 | + } | ||
| 49 | 57 | ||
| 50 | } | 58 | } |
| 51 | </script> | 59 | </script> |