tabbar怎么些_vue 做的tabBar组件
:class="{active:message==item.path}"
v-for="(item,index) in atabs">
alt="">
{{item.title}}
export default {
props: {
selected: String,
},
name: 'tabbar',
data () {
return {
message: this.selected,
atabs: [
{ title: '首頁', path: 'index', icon: require('@/assets/images/index.png'), icon_active: require('@/assets/images/index-active.png') },
{ title: '附近門店', path: 'storeLists', icon: require('@/assets/images/storeLists.png'), icon_active: require('@/assets/images/storeLists-active.png') },
{ title: '我的', path: 'gettheOrder', icon: require('@/assets/images/gettheOrder.png'), icon_active: require('@/assets/images/gettheOrder-active.png') }
]
}
},
methods: {
go (url) {
this.$router.push(`/${url}`)
}
},
}
.tabbar {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 0.45rem;
ul {
width: 100%;
height: 100%;
display: flex;
justify-content: space-around;
background-color: #fff;
li {
display: flex;
flex-direction: column;
justify-content: center;
width: 100%;
text-align: center;
// padding: 7px 0;
border-top: 1px solid #eaeaea;
font-size: 0.1rem;
img {
width: 0.2rem;
height: 0.2rem;
margin: 5px auto 0px;
}
&.active {
color: #ff5621;
font-weight: bold;
}
}
}
}
總結(jié)
以上是生活随笔為你收集整理的tabbar怎么些_vue 做的tabBar组件的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python内置函数教程_Python内
- 下一篇: mysql timestamp 用法_M