<router-link></router-link>存在router-link-active属性,那么底部tabbar切换就简单多了。不会再出现刷新回到第一个的bug。

<div class="tabbar">
<footer class="footer">
<router-link to='/Wechat' tag='li' class="footer__li--1"></router-link>
<router-link to='/Message' tag='li' class="footer__li--2"></router-link>
<router-link to='/Explore' tag='li' class="footer__li--3"></router-link>
<router-link to='/News' tag='li' class="footer__li--4"></router-link>
</footer>
<div style="height:50px;"></div>
</div>
<style lang='less'>
*{margin:;padding:;}
li,ol,ul{list-style: none;}
.tabbar {
.footer {
width:%;
position: absolute;
left:;
bottom:;
border-top:1px solid #ddd;
&__li--{
width: %;
height:50px;
background:url('/static/home.png') center no-repeat;
background-size: %;
float: left;
&.router-link-active {
background:url('/static/home-active.png') center no-repeat;
background-size: %;
}
}
&__li--{
width: %;
height:50px;
background:url('/static/information.png') center no-repeat;
background-size: %;
float: left;
&.router-link-active {
background:url('/static/information-active.png') center no-repeat;
background-size: %;
}
}
&__li--{
width: %;
height:50px;
background:url('/static/write.png') center no-repeat;
background-size: %;
float: left;
&.router-link-active {
background:url('/static/write-active.png')center no-repeat;
background-size: %;
}
}
&__li--{
width: %;
height:50px;
background:url('/static/me.png') center no-repeat;
background-size: %;
float: left;
&.router-link-active {
background:url('/static/me-active.png') center no-repeat;
background-size: %;
}
}
}
}
</style>

vue,一路走来(17)--底部tabbar切换的更多相关文章

  1. vue,一路走来(2)--路由vue-router

    安装 Mint UI cnpm install mint-ui --save 如果你的项目会用到 Mint UI 里较多的组件,最简单的方法就是把它们全部引入.此时需要在入口文件 main.js 中: ...

  2. vue,一路走来(1)--构建vue项目

    2016年12月--2017年5月,接触前端框架vue,一路走来,觉得有必要把遇到的问题记录下来. 那时,vux用的是1.0的vue,然而vue2.0已经出来了,于是我结合了mint-ui一起来做项目 ...

  3. vue,一路走来(17)--vue使用scss,并且全局引入公共scss样式

    最近朋友问如何在vue项目中使用scss样式,想起之前项目是直接在main.js直接import css文件的,然而main.js不可以直接import scss文件. import './asset ...

  4. vue,一路走来(9)--聊天窗口

    闲暇时间,介绍一下我做一个聊天窗口的心得.如图: 首先要考虑的是得判断出是自己的信息还是对方发来的信息,给出如图的布局,切换不同的类. <li class="clearfix" ...

  5. vue,一路走来(16)--本地及手机调试

    闲暇时间记录一下如何绑定域名,实现本地及手机调试的过程.我的是微信开发项目,很多功能及操作都是基于微信来开发的,理所当然的就用到微信开发者工具了. 1.首先打开目录C:\Windows\System3 ...

  6. vue,一路走来(13)--vue微信分享

    vue微信分享 今天记录一下vue微信分享. 1.先登录微信公众平台进入“公众号设置”的“功能设置”里填写“JS接口安全域名”.这个不多说,见文档,只有绑定了才能进行下一步的动作 2.需要引入js文件 ...

  7. vue,一路走来(12)--父与子之间传参

    今天想起一直没有记录父组件与子组件的传参问题,这在项目中一直用到. 父向子组件传参 Index.vue父组件中 <component-a :msgfromfa="(positionno ...

  8. vue,一路走来(7)--响应路由参数的变化

    今天描述的问题估计会有很多人也遇到过. vue-router多个路由地址绑定一个组件造成created不执行 也就是文档描述的,如下图 我的解决方案: created () { console.log ...

  9. vue,一路走来(6)--微信支付

    微信支付 https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6 分享一下vue实现微信支付.在微信浏览器里面 ...

随机推荐

  1. No Spring Session store is configured: set the 'spring.session.store-type'

    发现session store type使用来存放session的存储方式,目前Spring boot中只支持Redis方式. 由于本应用暂无需将session放入redis的需求,故这里就可以将se ...

  2. man arch

    ARCH(1)   Linux Programmer?. Manual/Linux程序员手册       ARCH(1) NAME/名称       arch - print machine arch ...

  3. [洛谷P1095]NOIP2007 普及组T3 守望者的逃离

    问题描述 恶魔猎手尤迪安野心勃勃,他背叛了暗夜精灵,率领深藏在海底的娜迦族企图叛变.守望者在与尤迪安的交锋中遭遇了围杀,被困在一个荒芜的大岛上.为了杀死守望者,尤迪安开始对这个荒岛施咒,这座岛很快就会 ...

  4. navigator.userAgent.toLowerCase();判断浏览器做兼容

    js简单实例: var ua = navigator.userAgent.toLowerCase(); if (/android/.test(ua)) { $('.date>div>img ...

  5. 20180910-Java 文档注释

    Java 文档注释 Java只是三种注释方式.前两种分别是// 和/* */,第三种被称作说明注释,它以/** 开始,以 */结束. // /* */ /** */ 说明注释允许你在程序中嵌入关于程序 ...

  6. iOS7上leftBarButtonItem无法实现滑动返回的完美解决方案

    今天遇到了在iOS7上使用leftBarButtonItem却无法响应滑动返回事件的问题,一番谷歌,最后终于解决了,在这里把解决方案分享给大家. 在iOS7之前的系统,如果要自定义返回按钮,直接设置b ...

  7. IDEA设置Ctrl+滚轮调整字体大小(转载)

    按Ctrl+Shift+A,出现搜索框 输入mouse: 点击打开这个设置:勾选 点击ok,之后就可以通过Ctrl+滚轮 调整字体大小了. 转载自:http://www.cnblogs.com/LUA ...

  8. (转)dial tcp 10.96.0.1:443: getsockopt: no route to host --- kubernetes(k8s)DNS 服务反复重启

    转:https://blog.csdn.net/shida_csdn/article/details/80028905 kubernetes(k8s)DNS 服务反复重启解决: k8s.io/dns/ ...

  9. 关于线段树or 树状树状 在二维平面搞事情!Orz

    第一式:https://ac.nowcoder.com/acm/contest/143/I 题意: 有 n 个点,一个点集 S 是好的,当且仅当对于他的每个子集 T,存在一个右边无限长的矩形,使得这个 ...

  10. CSU 1551 Longest Increasing Subsequence Again(树状数组 或者 LIS变形)

    题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1551 升级版:Uva 1471 题意: 让你求删除一段连续的子序列之后的LIS. 题 ...