本节:可以横向滑动的菜单栏。
在外面套这个标签就可以了。
<scroll-view scroll-x="true">
</scroll-view>
完整代码:
<template>
<view>
<view class="top">
<view class="" style="display: flex;">
<view class="" style="font-size: 40rpx;font-weight:600">
推荐
</view>
<view class="" style="color: #dcdbe3;margin-left: 30rpx;margin-top: 10rpx
;">
直播
</view>
<view class="" style="color: #dcdbe3;margin-left: 30rpx;margin-top: 10rpx">
关注
</view>
</view>
<view class="">
<image style="margin-right: 30rpx;width: 90rpx;height: 80rpx;" src="../../static/suos.jpg" mode="">
</image>
</view>
</view>
<view class="lunbo1">
<view class="page-section swiper">
<view>
<view class="" style="margin-top: 50rpx;">
<scroll-view class="nav1" scroll-x="true" style="">
<view class="" style="background-color:#FFFFFF;display: flex;width:1800rpx;height: 200rpx;">
<view class="" style="padding-left: 20rpx;margin-top: 10rpx;">
<image src="../../static/11.jpg" mode="" style="width: 270rpx;height: 160rpx;">
</image>
</view>
<view class="" style="padding-left: 20rpx;margin-top: 10rpx;">
<image src="../../static/22.jpg" mode="" style=" width: 270rpx;height: 160rpx;">
</image>
</view>
<view class="" style="padding-left: 20rpx;margin-top: 10rpx;">
<image src="../../static/11.jpg" mode="" style="width: 270rpx;height: 160rpx;">
</image>
</view>
<view class="" style="padding-left: 20rpx;margin-top: 10rpx;">
<image src="../../static/22.jpg" mode="" style="width: 270rpx;height: 160rpx;">
</image>
</view>
<view class="" style="padding-left: 20rpx;margin-top: 10rpx;">
<image src="../../static/11.jpg" mode="" style="width: 270rpx;height: 160rpx;">
</image>
</view>
<view class="" style="padding-left: 20rpx;margin-top: 10rpx;">
<image src="../../static/11.jpg" mode="" style="width: 270rpx;height: 160rpx;">
</image>
</view>
</view>
</scroll-view>
</view>
</view>
<view class="" style="margin-left: 30rpx;font-weight: 550;margin-top: 30rpx;">
排行榜
</view>
<view class="">
<view class="" style="margin-top: 20rpx;">
<scroll-view class="nav1" scroll-x="true" style="">
<view class="" style="background-color:#FFFFFF;display: flex;width:1200rpx;height: 350rpx;">
<view class="" style="padding-left: 20rpx;margin-top: 10rpx;">
<image src="../../static/xia.png" mode=""
style="width: 230rpx;height: 250rpx; position: absolute;">
</image>
<view class=""
style="text-align: center; position: relative;width: 230rpx;height: 130rpx;border-radius: 20rpx;margin-top: 230rpx;background-color: white;">
<view class="" style="font-weight: 50;">
畅销排行
</view>
<view class="" style="color: #d4d2dd;margin-top: 10rpx;">
2019/09/09
</view>
</view>
</view>
<view class="" style="padding-left: 20rpx;margin-top: 10rpx;">
<image src="../../static/cc.png" mode=""
style="width: 230rpx;height: 250rpx; position: absolute;">
</image>
<view class=""
style="text-align: center; position: relative;width: 230rpx;height: 130rpx;border-radius: 20rpx;margin-top: 230rpx;background-color: white;">
<view class="" style="font-weight: 50;">
畅销排行
</view>
<view class="" style="color: #d4d2dd;margin-top: 10rpx;">
2019/09/09
</view>
</view>
</view>
<view class="" style="padding-left: 20rpx;margin-top: 10rpx;">
<image src="../../static/caje.png" mode=""
style="width: 230rpx;height: 250rpx; position: absolute;">
</image>
<view class=""
style="text-align: center; position: relative;width: 230rpx;height: 130rpx;border-radius: 20rpx;margin-top: 230rpx;background-color: white;">
<view class="" style="font-weight: 50;">
畅销排行
</view>
<view class="" style="color: #d4d2dd;margin-top: 10rpx;">
2019/09/09
</view>
</view>
</view>
<view class="" style="padding-left: 20rpx;margin-top: 10rpx;">
<image src="../../static/cc.png" mode=""
style="width: 230rpx;height: 250rpx; position: absolute;">
</image>
<view class=""
style="text-align: center; position: relative;width: 230rpx;height: 130rpx;border-radius: 20rpx;margin-top: 230rpx;background-color: white;">
<view class="" style="font-weight: 50;">
畅销排行
</view>
<view class="" style="color: #d4d2dd;margin-top: 10rpx;">
2019/09/09
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
<view class="" style="display: flex;
justify-content: space-between;margin-top: 20rpx;">
<view class="" style="margin-left: 30rpx;font-weight: 550;">
最近上线
</view>
<view class="" style="color: #c9c9c9; margin-right: 50rpx;font-size: 20rpx;">
查看全部
</view>
</view>
<view class="" style="height: 1200rpx;">
<view class="" style="display: flex;
justify-content: space-between;">
<view class="" style="margin-top: 30rpx;margin-left: 20rpx;">
<image src="../../static/xia.png" mode="" style="width: 250rpx;height: 250rpx;"></image>
</view>
<view class="">
<view class="" style="margin-top: 50rpx; font-weight: 550;font-size: 35rpx;">
你一直在寻找的西湖大闸蟹...
</view>
<view class="" style="margin-top: 35rpx;color: #d0ceda;">
千里寻海岸酒店
</view>
<view class="" style="margin-top: 35rpx;display: flex;">
<view class="" style="color: #ff5d37;font-weight: 550;font-size: 35rpx;">
¥199.9
</view>
<view class="" style="margin-left: 100rpx; color: #dadada;">
1999人已买
</view>
</view>
</view>
</view>
<view class="" style="display: flex;
justify-content: space-between;">
<view class="" style="margin-top: 30rpx;margin-left: 20rpx;">
<image src="../../static/cc.png" mode="" style="width: 250rpx;height: 250rpx;"></image>
</view>
<view class="">
<view class="" style="margin-top: 50rpx; font-weight: 550;font-size: 35rpx;">
你一直在寻找的西湖大闸蟹...
</view>
<view class="" style="margin-top: 35rpx;color: #d0ceda;">
千里寻海岸酒店
</view>
<view class="" style="margin-top: 35rpx;display: flex;">
<view class="" style="color: #ff5d37;font-weight: 550;font-size: 35rpx;">
¥199.9
</view>
<view class="" style="margin-left: 100rpx; color: #dadada;">
1999人已买
</view>
</view>
</view>
</view>
<view class="" style="display: flex;
justify-content: space-between;">
<view class="" style="margin-top: 30rpx;margin-left: 20rpx;">
<image src="../../static/xia.png" mode="" style="width: 250rpx;height: 250rpx;"></image>
</view>
<view class="">
<view class="" style="margin-top: 50rpx; font-weight: 550;font-size: 35rpx;">
你一直在寻找的西湖大闸蟹...
</view>
<view class="" style="margin-top: 35rpx;color: #d0ceda;">
千里寻海岸酒店
</view>
<view class="" style="margin-top: 35rpx;display: flex;">
<view class="" style="color: #ff5d37;font-weight: 550;font-size: 35rpx;">
¥199.9
</view>
<view class="" style="margin-left: 100rpx; color: #dadada;">
1999人已买
</view>
</view>
</view>
</view>
</view>
<view class=""
style="width: 100%;height: 120rpx;display: flex;position: fixed;bottom: 0rpx;background-color: white;">
<view class="" style="flex: 1; ">
<image style="margin-top: 10rpx;margin-left: 70rpx;width: 60rpx;height: 60rpx;"
src="../../static/sy.png" mode=""></image>
<view class="" style="margin-left: 70rpx; color: #fe915d;">
首页
</view>
</view>
<view class="" style="flex: 1; ">
<image style="margin-top: 10rpx;margin-left: 70rpx;width: 60rpx;height: 60rpx;"
src="../../static/xx.png" mode=""></image>
<view class="" style="margin-left: 70rpx; color: #d2d2d2;">
学习
</view>
</view>
<view class="" style="flex: 1; ">
<image style="margin-top: 10rpx;margin-left: 70rpx;width: 60rpx;height: 60rpx;"
src="../../static/ld.png" mode=""></image>
<view class="" style="margin-left: 70rpx;color: #d2d2d2;">
消息
</view>
</view>
<view class="" style="flex: 1;">
<image style="margin-top: 10rpx;margin-left: 70rpx;width: 60rpx;height: 60rpx;"
src="../../static/zx.png" mode=""></image>
<view class="" style="margin-left: 70rpx; color: #d2d2d2;">
我的
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
indicatorDots: true,
autoplay: true,
interval: 3000,
duration: 500,
indicatorColor: "#292b40",
indicatorActiveColor: "#ffffff"
}
},
methods: {
}
}
</script>
<style>
.banner {
width: 350rpx;
height: 422rpx;
background-color: #0f0f27;
}
.banner .swiper {
width: 350rpx;
height: 422rpx !important;
}
.banner .swiper-item {
width: 350rpx;
height: 422rpx !important;
}
.banner .swiper-item image {
display: block;
width: 350rpx;
height: 422rpx !important;
}
.top {
padding-top: 30rpx;
width: 100%rpx;
height: 35rpx;
display: flex;
justify-content: space-between;
padding-left: 30rpx;
}
</style>