vue底部导航

<template>
  <div class="footer">
    <div class="foot">
      <div class="bottom-tab">
        <div class="tab-item" @click="switchTo('/job')">
          <img :src="'/job' === $route.path|| '/' === $route.path? tabBarImgArr[0].selected : tabBarImgArr[0].normal" alt="职位">
          <span :class="{footSelect: '/job' === $route.path}">职位</span>
        </div>
        <div class="tab-item" @click="switchTo('/company')">
          <img :src="'/company' === $route.path ? tabBarImgArr[1].selected : tabBarImgArr[1].normal" alt="公司">
          <span :class="{footSelect: '/company' === $route.path}">公司</span>
        </div>
        <div class="tab-item" @click="switchTo('/message')">
          <img :src="'/message' === $route.path ? tabBarImgArr[2].selected : tabBarImgArr[2].normal" alt="消息">
          <span :class="{footSelect: '/message' === $route.path}">消息</span>
        </div>
        <div class="tab-item" @click="switchTo('/my')">
          <img :src="'/my' === $route.path ? tabBarImgArr[3].selected : tabBarImgArr[3].normal" alt="我的">
          <span :class="{footSelect: '/my' === $route.path}">我的</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  export default {
    name:"foot",
    data() {
      return {
        tabBarImgArr:[
          {selected:require("@/assets/img/ic_main_tab_find_pre.png"),normal:require("@/assets/img/ic_main_tab_find_nor.png")},
          {selected:require("@/assets/img/ic_main_tab_company_pre.png"),normal:require("@/assets/img/ic_main_tab_company_nor.png")},
          {selected:require("@/assets/img/ic_main_tab_contacts_pre.png"),normal:require("@/assets/img/ic_main_tab_contacts_nor.png")},
          {selected:require("@/assets/img/ic_main_tab_my_pre.png"),normal:require("@/assets/img/ic_main_tab_my_nor.png")},
        ]
      };
    },

    methods:{
      switchTo: function (path) {
        this.$router.replace(path)
      }
    }
  };
</script>
<style scoped>
  .bottom-tab{
    position: fixed;
    bottom: 0;
    left: 0;
    display: flex;
    border-top: 1px solid #D9D9D9;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .bottom-tab .tab-item{
    flex: 1;
    text-align: center;
  }
  .bottom-tab .tab-item img{
    display: block;
    width: 30%;
    margin: 0 auto;
  }
  .bottom-tab .tab-item span{
    font-size: 12px;
    color: #B3B3B3;
  }
  .footSelect{
    color: #58CDC6!important;
  }
</style>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值