uniapp中出现图片过小会与盒子偏离

结论:在image的父盒子中加上display: flex,原因不清楚

出问题的代码和图片如下:

复制代码
<template>
	<view style=" background-color: greenyellow; height: 10rpx;width: 10rpx;">
		<image :src="imgSrc.seatnull"  style="width: 100%; height: 100%; background-color: aqua;"> </image>
	</view>
</template>

当父盒子的大小过小,就出现了图片和父盒子偏离的情况

解决方法,使父盒子变为弹性盒子就可以解决

复制代码
	<view style=" background-color: greenyellow; height: 10rpx;width: 10rpx;display: flex;">
		<image :src="imgSrc.seatnull"  style="width: 100%; height: 100%; background-color: aqua;"> </image>
	</view>
相关推荐
摘星编程26 分钟前
React Native for OpenHarmony 实战:Alert 警告提示详解
javascript·react native·react.js
Joe55629 分钟前
vue2 + antDesign 下拉框限制只能选择2个
服务器·前端·javascript
WHS-_-202242 分钟前
Tx and Rx IQ Imbalance Compensation for JCAS in 5G NR
javascript·算法·5g
摘星编程42 分钟前
React Native for OpenHarmony 实战:GestureResponderSystem 手势系统详解
javascript·react native·react.js
lili-felicity1 小时前
React Native for OpenHarmony 实战:加载效果的实现详解
javascript·react native·react.js·harmonyos
ChangYan.1 小时前
monorepo 多包管理识别不到新增模块,解决办法
前端·chrome
Jinuss1 小时前
React元素创建介绍
前端·react.js
时光慢煮1 小时前
从踩坑到跑通:uni-app 项目落地 HarmonyOS 的完整实录(含模拟器 / 真机)
华为·uni-app·harmonyos
济6171 小时前
linux 系统移植(第六期)--Uboot移植(5)--bootcmd 和 bootargs 环境变量-- Ubuntu20.04
java·前端·javascript
FFF-X1 小时前
UniApp 小程序实现自定义每张图片播放时长的轮播图(基于 uView 的 u-swiper)
小程序·uni-app