list-scroll组件放到swiper中后显示出了问题

来源:5-11 实现内容切换

Svanur

2021-01-14

老师,我按视频中的做法把整个list-scroll组件放到swiper组件中之后,底下有大概2/3的内容都不知道被什么东西遮住了
效果图
这是list-scroll组件的代码

<template>
	<view class="scroll">
		<scroll-view class="list-scroll" scroll-y="true">
			<view>
				<slot></slot>
			</view>
		</scroll-view>
	</view>
</template>

<script>...

<style lang="scss">
	.scroll {
		flex: 1;
		overflow: hidden;
		box-sizing: border-box;
		
		.list-scroll {
			height: 100%;
			display: flex;
			flex-direction: column;
		}
	}
</style>

这是页面代码

<template>
	<view class="home">
		<!-- 自定义导航栏组件 -->
		<navbar></navbar>
		<tab :list="tabList" @tab="tab"></tab>
		<view class="home-list">
			<list></list>
		</view>
	</view>
</template>

<script>...

<style lang="scss">
	page{
		height: 100%;
		display: flex;
	}
	.home{
		display: flex;
		flex-direction: column;
		flex: 1;
		overflow: hidden;
		.home-list{
			flex: 1;
			box-sizing: border-box;
			border: 1px red solid;
		}
	}
</style>

写回答

1回答

Svanur

提问者

2021-01-15

又检查了一遍找到原因了,是因为list-scroll最外层的view的类名跟底下css类名不一样,我还找了老半天。。


0
0

uni-app实战 以项目为导向 掌握完整开发流程

跟着uni-app团队开发成员快速上手高效率框架,打通前后端,完成初级全栈开发

1104 学习 · 544 问题

查看课程