uniapp flex:1不生效

包裹view顶层 不能添加 display: flex;

<template>
	<view class="container">
		<tHeader :title="'采购管理'" :showScrollTar="true" :scroll="scroll" :tabList="tabList" :isFixed="true"
			@change="changeTar" :current='current'>
		</tHeader>
		<view class="container-content-box">
			<view v-for="(item,index) in inventoryCostList" :key="index">
				<view class="cost-item-title-box">
					<uni-icons type="staff" color="#2167FF" size="24"></uni-icons>
					<view class="cost-item-title-name-box">
						{{item.deptName}}
					</view>
				</view>
				<view class="cost-item-content-box">
					<view class="cost-item-content-flex-box">
						<view class="cost-item-content-flex-name-box">
							自采成本
						</view>
						<view class="cost-item-content-flex-value-box">
							¥{{item.selfPrice}}
						</view>
					</view>
					<view class="cost-item-content-flex-box">
						<view class="cost-item-content-flex-name-box">
							采购调拨成本
						</view>
						<view class="cost-item-content-flex-value-box">
							¥{{item.allotPrice}}
						</view>
					</view>
					<view class="cost-item-content-flex-box">
						<view class="cost-item-content-flex-name-box">
							采购调拨成本
						</view>
						<view class="cost-item-content-flex-value-box">
							¥{{item.allotPrice}}
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<style lang="scss">
	.container {
		background-color: #F4F8FB;
		height: 100%;
		width: 100%;

		.btn-box {
			display: flex;
			justify-content: flex-end;
			align-items: center;
			padding-right: 24rpx;
			color: #FFF;
		}

		.container-title-height {
			height: calc(var(--status-bar-height) + 150rpx);
		}

		.date-picker-box {
			background-color: #fff;
			display: flex;
			justify-content: center;
			align-items: center;
			color: #00327D;
			font-size: 30rpx;
			line-height: 30rpx;
			padding: 30rpx 0;

			.date-icon {
				display: inline-block;
				width: 30rpx;
				height: 30rpx;
			}

			.start-text {
				padding-left: 20rpx;
			}

			.date-connect {
				padding: 0 8rpx;
			}
		}

		.container-content-box {
			background-color: #FFF;
			border-radius: 10rpx;
			margin: 25rpx;
			padding: 25rpx;

			.cost-item-title-box {
				display: flex;
				align-items: center;
				justify-content: center;
				color: #333;
				flex-direction: row;

				.cost-item-title-name-box {
					font-size: 30rpx;
					font-weight: bold;
				}
			}

			.cost-item-content-box {
				background-color: #F7FAFF;
				padding: 25rpx;
				margin: 20rpx;
				flex-direction: row;
				border-radius: 10rpx;
				display: flex;

				.cost-item-content-flex-box {
					display: flex;
					flex: 1;
					align-items: center;
					justify-content: center;
					color: #333;
					flex-direction: column;

					.cost-item-content-flex-name-box {
						color: #666;
						display: flex;
						font-size: 26rpx;
					}

					.cost-item-content-flex-value-box {
						color: #333;
						font-size: 24rpx;
						margin-top: 15rpx;
						font-weight: bold;
					}
				}
			}
		}
	}
</style>

这一层级,不能写display: flex;写了底下的 flex:1 不生效

.container-content-box{}

相关推荐
变色龙云1 小时前
uni-app开发完成app上传OPPO认定为马甲包如何处理?
uni-app
用户480622604141516 小时前
使用uniapp开发微信小程序-框架搭建
微信小程序·uni-app
TttHhhYy18 小时前
uniapp+vue开发app,蓝牙连接,蓝牙接收文件保存到手机特定文件夹,从手机特定目录(可自定义),读取文件内容,这篇首先说如何读取,手机目录如何寻找
开发语言·前端·javascript·vue.js·uni-app
Funky_oaNiu18 小时前
uniapp实现按钮防重复点击(防抖)完整解决方案
uni-app
原克技术18 小时前
uniapp验证码
uni-app
web150850966412 天前
在uniapp Vue3版本中如何解决webH5网页浏览器跨域的问题
前端·uni-app
何极光2 天前
uniapp小程序样式穿透
前端·小程序·uni-app
User_undefined3 天前
uniapp Native.js 调用安卓arr原生service
android·javascript·uni-app
流氓也是种气质 _Cookie3 天前
uniapp blob格式转换为video .mp4文件使用ffmpeg工具
ffmpeg·uni-app
爱笑的眼睛113 天前
uniapp 极速上手鸿蒙开发
华为·uni-app·harmonyos