vue,一路走来(17)--底部tabbar切换
<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切换的更多相关文章
- vue,一路走来(2)--路由vue-router
安装 Mint UI cnpm install mint-ui --save 如果你的项目会用到 Mint UI 里较多的组件,最简单的方法就是把它们全部引入.此时需要在入口文件 main.js 中: ...
- vue,一路走来(1)--构建vue项目
2016年12月--2017年5月,接触前端框架vue,一路走来,觉得有必要把遇到的问题记录下来. 那时,vux用的是1.0的vue,然而vue2.0已经出来了,于是我结合了mint-ui一起来做项目 ...
- vue,一路走来(17)--vue使用scss,并且全局引入公共scss样式
最近朋友问如何在vue项目中使用scss样式,想起之前项目是直接在main.js直接import css文件的,然而main.js不可以直接import scss文件. import './asset ...
- vue,一路走来(9)--聊天窗口
闲暇时间,介绍一下我做一个聊天窗口的心得.如图: 首先要考虑的是得判断出是自己的信息还是对方发来的信息,给出如图的布局,切换不同的类. <li class="clearfix" ...
- vue,一路走来(16)--本地及手机调试
闲暇时间记录一下如何绑定域名,实现本地及手机调试的过程.我的是微信开发项目,很多功能及操作都是基于微信来开发的,理所当然的就用到微信开发者工具了. 1.首先打开目录C:\Windows\System3 ...
- vue,一路走来(13)--vue微信分享
vue微信分享 今天记录一下vue微信分享. 1.先登录微信公众平台进入“公众号设置”的“功能设置”里填写“JS接口安全域名”.这个不多说,见文档,只有绑定了才能进行下一步的动作 2.需要引入js文件 ...
- vue,一路走来(12)--父与子之间传参
今天想起一直没有记录父组件与子组件的传参问题,这在项目中一直用到. 父向子组件传参 Index.vue父组件中 <component-a :msgfromfa="(positionno ...
- vue,一路走来(7)--响应路由参数的变化
今天描述的问题估计会有很多人也遇到过. vue-router多个路由地址绑定一个组件造成created不执行 也就是文档描述的,如下图 我的解决方案: created () { console.log ...
- vue,一路走来(6)--微信支付
微信支付 https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6 分享一下vue实现微信支付.在微信浏览器里面 ...
随机推荐
- 《Webkit技术内幕》之页面渲染过程
文章同步到github<Webkit技术内幕>之页面渲染过程 最近拜读了传说中的<Webkit技术内幕>一书,有很大收获,尤其是对页面渲染有了较深的认识.由于功力有限,而且书中 ...
- 编译原理--NFA/DFA
现成的, 讲义: https://www.cnblogs.com/AndyEvans/p/10240790.html https://www.cnblogs.com/AndyEvans/p/10241 ...
- js执行上下文与执行上下文栈
一.什么是执行上下文 简单说就是代码运行时的执行环境,必须是在函数调用的时候才会产生,如果不调用就不会产生这个执行上下文.在这个环境中,所有变量会被事先提出来(变量提升),有的直接赋值,有的为默认值 ...
- [tyvj]P1939玉蟾宫[单调栈]
[tyvj]P1939 玉蟾宫 ——!x^n+y^n=z^n 背景 有一天,小猫rainbow和freda来到了湘西张家界的天门山玉蟾宫,玉蟾宫宫主蓝兔盛情地款待了它们,并赐予它们一片土地. 描述 这 ...
- elk+kafka+zookeeper+filebeat安装
ElasticSearch6.0 ElasticSearch6.0安装 #依赖jdk8 rpm -ivh elasticsearch-.rpm vim /etc/elasticsearch/elast ...
- jstl学习资料
jstl印象中叫标准标签库,是apache的一个项目,网址为: Apache Taglibs - Apache Standard Taglib: JSP[tm] Standard Tag Librar ...
- C# get和set
Day1:知识点 1.封装 自己的理解: 可复用,低耦合.就是拿过来就用 只需要关注名称,返回值,参数及参数类型,不需要知道里面怎么实现的. 字段封装的快捷键 (ctrl+r+e) 将光标放在将要封 ...
- HDU 4321 Arcane Numbers 2
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4321 ----------------------------------------------- ...
- 使用 Select2 下拉框实现复选
使用 Select2 下拉框实现复选 <!DOCTYPE html> <html> <head> <meta http-equiv="Content ...
- poj3614Sunscreen
Description To avoid unsightly burns while tanning, each of the C (1 ≤ C ≤ 2500) cows must cover her ...