flex 多行平均分布

<template>
<view>
<view class="__y-file-list">
<view class="__y-file" v-for="item in 9">
<image class="__y-image" src="../../static/img/missing-face.png" mode=""></image>
<view class="__y-close-btn">
<text class="cuIcon-close __close-icon"></text>
<!-- <image src="./static/close.png" mode=""></image> -->
</view>
</view>
<!-- <view class="file" v-for="(v, i) in previewImgList" :key="i">
<u-image width="150rpx" height="150rpx" class="img" :src="v" mode="" borderRadius="8"
@click="previewImage(i)">
<view slot="loading">
<u-loading mode="circle"></u-loading>
</view>
</u-image>
<u-icon name="../../static/qqhd/close.png" width="32" height="32" size="32" class="close"
color="#ffffff" @click="deleteImg(i)"></u-icon>
</view>
<view class="upload-btn" @click="chooseImage">
<view class="icon-bg">

</view>
</view> -->
</view>
</view>
</template>

<script>
export default {
name:"yiyun-upload",
data() {
return {

};
}
}
</script>

<style lang="scss" scoped>
.__y-file-list{
display: flex;
justify-content: space-between;
flex-direction: row;
flex-wrap: wrap;
// 占位符,靠它实现平均
&:after{
content: '';
height: 0;
width: 30%;
}
.__y-file {
flex: 0 0 30%;
margin-top: 24rpx;
// margin-right: 24rpx;
position: relative;
width: 150rpx;
height: 150rpx;

.__y-image{
width: 100%;
height: 100%;
overflow: hidden;
}
.__y-close-btn{
// width: 60rpx;
// height: 60rpx;
position: absolute;
top: 0;
right: 0;
.__close-icon{
background-color: #999;
border-radius: 50%;
font-size: 38rpx;
padding: 6rpx;
color: #FFFFFF;
}
}
}
}
</style>

posted @   小寒爱吃西红柿  阅读(383)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示