vux Tabbar组件入门备忘大佬多指点

一、Tabbar引入及使用

1、新创建vue文件

2、在vue文件中添加插件

<template>
<div>
<tabbar style="position:fixed">
<tabbar-item selected >
<img slot="icon" src=" ../src/images/home1.png">
<img slot="icon-active" src=" ../src/images/home.png">
<span slot="label">首页</span>
</tabbar-item >
<tabbar-item link="#">
<img slot="icon" src=" ../src/images/home1.png">
<img slot="icon-active" src=" ../src/images/home.png">
<span slot="label">首页</span>
</tabbar-item>
<tabbar-item link="#">
<img slot="icon" src=" ../src/images/home1.png">
<img slot="icon-active" src=" ../src/images/home.png">
<span slot="label">首页</span>
</tabbar-item>
<tabbar-item link="#">
<img slot="icon" src=" ../src/images/home1.png">
<img slot="icon-active" src=" ../src/images/home.png">
<span slot="label">首页</span>
</tabbar-item>
</tabbar>
</div>
</template>
3.引入插件
<script>
import { Tabbar, TabbarItem } from 'vux'
export default {
components: {
Tabbar,
TabbarItem
}
}
</script>

二、注意事项

1、默认定位为 absolute,适用于 100%页面布局,如果你并非 100% 布局(可以配合使用 view-box 组件),请手动重置样式为 position: fixed

2、tabbar默认切换颜色为绿色如需要修改 

2.1、先修改build文件夹下webpack.base.conf.js文件

2.2、按照自己的路径创建vux_theme.less样式文件并添加样式

@tabbar-text-active-color: #f592c2;
3、改变选中图片为
<img slot="icon-active" src=" ../src/images/home.png">

三、最终效果

 

 

转载于:https://www.cnblogs.com/-mo-xue-/p/10138311.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值