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实现微信支付.在微信浏览器里面 ...
随机推荐
- Facebook超过1亿用户数据泄露,疑与中国黑客组织有关?
Facebook又向用户投放了另一个重磅炸弹,承认其超过1亿用户中的所有用户都应该认定恶意的第三方垃圾信息以及强大的黑客组织泄露了他们的公开个人资料信息. 周三,Facebook首席执行官马克扎克伯格 ...
- 01.helloworld--标签
"""参考网站:http://python.cocos2d.org/doc/programming_guide/index.html""" ...
- rocketmq启动broker内存占用过大的问题
解决方法: 修改broker启动脚本runbroker.sh里面的jvm参数 JAVA_OPT="${JAVA_OPT} -server -Xms8g -Xmx8g -Xmn4g" ...
- 【leetcode】1073. Adding Two Negabinary Numbers
题目如下: Given two numbers arr1 and arr2 in base -2, return the result of adding them together. Each nu ...
- Intent.java分析
代码位于frameworks/base/core/java/anroid/Content/Intent.java Intent是对要进行操作的一种抽象描述.用action抽象操作,用data(andr ...
- git 常用命令记录
删除远程分支 git push origin --delete 远程分支名 删除本地分支 git branch -d 本地分支名 从master新建分支 git checkout -b 新分支名 建立 ...
- C语言 为什么要引入指针?
https://blog.csdn.net/chengxuyuan997/article/details/81231679 正文 在说为什么引入指针这个问题前先带大家了解一下什么是指针? 指针最为简短 ...
- Python3解leetcode N-ary Tree Level Order Traversal
问题描述: Given an n-ary tree, return the level order traversal of its nodes' values. (ie, from left to ...
- 关闭本机的代理服务(Proxy)
若您使用了代理服务(Proxy),可能会导致战网游戏发生网络连接.安装或更新方面的问题.请参考以下步骤来关闭您电脑的网络代理服务. Windows 按下 Windows 按鍵 + R . 在运行框中, ...
- Search Engine Hacking – Manual and Automation
Search Engine Hacking – Manual and Automation Ethical Hacking Boot Camp OUR MOST POPULAR COURSE! CLI ...