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{}

相关推荐
瑶琴AI前端1 小时前
uniapp组件实现省市区三级联动选择
java·前端·uni-app
mosen8681 小时前
Uniapp去除顶部导航栏-小程序、H5、APP适用
vue.js·微信小程序·小程序·uni-app·uniapp
尚梦9 小时前
uni-app 封装刘海状态栏(适用小程序, h5, 头条小程序)
前端·小程序·uni-app
尚学教辅学习资料16 小时前
基于SSM+uniapp的营养食谱系统+LW参考示例
java·uni-app·ssm·菜谱
Bessie23416 小时前
微信小程序eval无法使用的替代方案
微信小程序·小程序·uni-app
qq22951165021 天前
小程序Android系统 校园二手物品交换平台APP
微信小程序·uni-app
qq22951165022 天前
微信小程序uniapp基于Android的流浪动物管理系统 70c3u
微信小程序·uni-app
qq22951165022 天前
微信小程序 uniapp+vue老年人身体监测系统 acyux
vue.js·微信小程序·uni-app
摇头的金丝猴2 天前
uniapp vue3 使用echarts-gl 绘画3d图表
前端·uni-app·echarts
小远yyds2 天前
跨平台使用高德地图服务
前端·javascript·vue.js·小程序·uni-app