mpvue 微信小程序 Image 图片实现宽度100%,高度自适应
主要是设置mode="widthFix"和width: 100%;<!-- 新手教程 --><template><div class="center-tutorial"><img class="img" src="https://1
·
主要是设置mode="widthFix"
和width: 100%;
<!-- 新手教程 -->
<template>
<div class="center-tutorial">
<img class="img" src="https://123.oss-cn-hangzhou.aliyuncs.com/666.jpeg" mode="widthFix">
</div>
</template>
<style lang="less" scoped>
.center-tutorial {
.img {
width: 100%;
}
}
</style>
更多推荐
已为社区贡献21条内容
所有评论(0)