Commit 714fad7f by 张成

update

parent 6d7235bc
<template> <template>
<!-- Tab --> <!-- Tab -->
<u-tabbar zIndex="10075" v-model="selectedTabbar" :border="false" inactive-color="#000000" active-color="#006ECF" :fixed="true" :safeAreaInsetBottom="true" @change="beforeSwitch"> <u-tabbar zIndex="10075" v-model="selectedTabbar" :border="false" inactive-color="#000000" active-color="#006ECF"
<u-tabbar-item v-for="(item,index) in list" :key="item.text" :text="item.text" :icon="selectedTabbar==index?item.activeIcon:item.icon"></u-tabbar-item> :fixed="true" :safeAreaInsetBottom="true" @change="beforeSwitch">
</u-tabbar> <u-tabbar-item v-for="(item, index) in list" :key="item.text" :text="item.text"
:icon="selectedTabbar == index ? item.activeIcon : item.icon"></u-tabbar-item>
</u-tabbar>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return{ return {
} }
}, },
props:['selectedTabbar'], props: ['selectedTabbar'],
computed:{ computed: {
list(){ list() {
// tabbar List // tabbar List
return this.$store.state.list; return this.$store.state.list;
} }
}, },
methods:{ methods: {
//点击tab //点击tab
beforeSwitch(index) { beforeSwitch(index) {
uni.switchTab({url:this.list[index].pagePath}); uni.switchTab({ url: this.list[index].pagePath });
return true; return true;
}
} }
}
} }
</script> </script>
<style> <style>
</style> </style>
\ No newline at end of file
{ {
"name": "hooloo",
"lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "lockfileVersion": 1,
"": {
"dependencies": {
"uview-ui": "^2.0.31"
}
},
"node_modules/uview-ui": {
"version": "2.0.31",
"resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.31.tgz",
"integrity": "sha512-I/0fGuvtiKHH/mBb864SGYk+SJ7WaF32tsBgYgeBOsxlUp+Th+Ac2tgz2cTvsQJl6eZYWsKZ3ixiSXCAcxZ8Sw==",
"engines": {
"HBuilderX": "^3.1.0"
}
}
},
"dependencies": { "dependencies": {
"uview-ui": { "uview-ui": {
"version": "2.0.31", "version": "2.0.31",
......
<template> <template>
<view> <view>
<view class="menu-banner">
<view class="log">
<image class="logImg" src="/static/imgs/hooloo.png"></image>
<view class="logText">未 来 咖 啡</view>
</view>
<image src="../../static/imgs/banner.png"></image>
</view>
<tabBar :selectedTabbar="selectedTabbar"></tabBar> <tabBar :selectedTabbar="selectedTabbar"></tabBar>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
selectedTabbar:2,//选中的tab selectedTabbar: 2,//选中的tab
}
},
computed:{
},
methods: {
} }
},
computed: {
},
methods: {
} }
}
</script> </script>
<style> <style lang="scss" scoped>
.menu-box {}
.menu-banner {
height: 376rpx;
position: relative;
.log {
position: absolute;
top: 100rpx;
left: 30rpx;
.logImg {
width: 312rpx;
height: 72rpx;
}
.logText {
font-size: 42rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: #FFFFFF;
}
}
image {
width: 100%;
height: 376rpx;
}
</style> }
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment