Vue-webapp 中的坑 使用Mint UI tabbar 点击之后图片改变的方法

vue-webapp 中的坑 (mint-ui很坑的,需要注意)Mint UI tabbar 点击之后图片改变的方法

下图就是Mint UI的tabbar组件代码 

htm代码:

<template>

<mt-tabbar v-model="tabBar" fixed>

<mt-tab-item id="Invest" @click.native="showInvest">

<router-link to="/" style=" text-decoration: none; color: #989898;">

<img src="../assets/ios/icon/Investment@2x.png" v-show="isshow">

<img src="../assets/ios/icon/Investment-1@2x.png" v-show="is_show">

投资

</router-link>

</mt-tab-item>

<mt-tab-item id="fllow" @click.native="showFllow">

<img src="../assets/ios/icon/follow@2x.png" v-show="isshow1">

<img src="../assets/ios/icon/follow-1@2x.png" v-show="is_show1">

关注

</mt-tab-item>

<mt-tab-item id="person" @click.native="showPerson">

<router-link to="/Login" style=" text-decoration: none; color: #989898;">

<img src="../assets/ios/icon/person@2x.png" v-show="isshow2">

<img src="../assets/ios/icon/person-1@2x.png" v-show="is_show2">

我的

</router-link>

</mt-tab-item>

</mt-tabbar>

</template>

js组件代码:

<script>

export default {

name: 'tabBar',

data() {

return {

tabBar: 'Invest',

selected:'',

isshow:false,

is_show:true,

isshow1:true,

is_show1:false,

isshow2:true,

is_show2:false,

};

},

methods: {

showInvest:function(){

this.isshow=false;

this.is_show=!this.isshow;

this.$options.methods.UnshowFllow.bind(this)();

this.$options.methods.UnshowPerson.bind(this)();

},

showFllow:function(){

this.isshow1=false;

this.is_show1=true;

this.$options.methods.UnshowInvest.bind(this)();

this.$options.methods.UnshowPerson.bind(this)();

},

showPerson:function(){

this.isshow2=false;

this.is_show2=true;

this.$options.methods.UnshowInvest.bind(this)();

this.$options.methods.UnshowFllow.bind(this)();

},

UnshowInvest:function(){

this.isshow=true;

this.is_show=false;

},

UnshowFllow:function(){

this.isshow1=true;

this.is_show1=false;

},

UnshowPerson:function(){

this.isshow2=true;

this.is_show2=false;

}

},



}

</script>

css组件样式代码:

/* 底部tabbar */

.footer .mint-tabbar {

background-color: #fff;

}

.footer .mint-tabbar.is-fixed {

height: 4.9rem;

line-height: 4.9rem;

border-top: 1px solid #e4e4e4;

}

.footer .mint-tab-item {

margin-top: 0.8rem;

}

.footer .mint-tab-item-label {

color: #989898;

font-size: 1rem;

font-weight: normal;

line-height: 1;

}

.footer img {

width: 2rem;

height: 2rem;

font-size: 2rem;

display: block;

margin: 0 auto;

margin-bottom: 0.45rem;

}

.footer .mint-tabbar > .mint-tab-item.is-selected {

background-color: #fff;

}

.footer .is-selected .mint-tab-item-label {

color: #ec4748;

}

最后为了方便大家的沟通与交流请加QQ群: 625787746

请进QQ群交流:【IT博客技术分享群①】:https://jq.qq.com/?_wv=1027&k=DceI0140

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

IT博客技术分享

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值