首页 > 其他分享 >上传多张图片的布局 flex布局 uniapp

上传多张图片的布局 flex布局 uniapp

时间:2022-10-10 09:55:49浏览次数:44  
标签:flex 20 uniapp 布局 height 80px 5px wrap

 1 <view class="input " style="display: flex;">
 2                 <span class="title" style="font—size: 16px;">图像信息:</span>
 3                 <view class="context" >

              //主要部分 7 <view class="wrap input-border"> 8 <view class="img-wrap" v-for="(item, index) in uploadDatas"> 9 <image class="image" @tap="previewUpload" :src="item" :data-url="item" mode="aspectFill"> 10 </image>
                    //删除按钮 11 <text class="diy-icon-close" @tap="uploadDatas.splice(index, 1)"></text> 12 </view> 13 <view class="upload-box" @tap="uploadImg"> 14 <text class="diy-icon-cameraadd"></text> 15 </view> 16 <input hidden :value="upload" name="upload" maxlength="-1" /> 17 </view>
18 </view> 20 </view>

 

 1 export default {
 2         data() {
 3             return {
 4                 uploadDatas: [],
 5                    }
 6         }
 7         methods:{
 8              previewUpload(e) {
 9                console.log('预览', e);
10                uni.previewImage({
11                    current: e.currentTarget.dataset.url, // 当前显示图片的http链接
12                    urls: [e.currentTarget.dataset.url] // 需要预览的图片http链接列表
13                });
14             },
15                         //上传
16             uploadUpload(e) {
17                 this.uploadImage(this, 'upload');
18             }, 
19               
20 }
21 }                

 

 

 

 1 .wrap {
 2         display: flex;
 3         flex-wrap: wrap;
 4     }
 5 
 6     .img-wrap {
 7         position: relative;
 8         display: flex;
 9         flex-direction: row;
10         flex-wrap: wrap;
11     }
12 
13     .img-wrap .image {
14         width: 80px;
15         height: 80px;
16         margin: 0 5px 5px 0;
17     }
18 
19     .img-wrap text {
20         position: absolute;
21         right: 10px;
22         top: 0;
23         display: block;
24         height: 25px;
25         width: 16px;
26         border-radius: 0 0 0 5px;
27         background-color: #161417;
28         color: #fff;
29     }
30 
31     .upload-box {
32         background-color: #F7F8FA;
33         width: 80px;
34         height: 80px;
35         line-height: 80px;
36         text-align: center;
37     }

 

标签:flex,20,uniapp,布局,height,80px,5px,wrap
From: https://www.cnblogs.com/changshu/p/16774571.html

相关文章

  • uniapp 实现回退监听 弹出提示 小程序与H5已解决
    H5小程序<!--退出填写提示框--><view>自定义提示框<viewv-if="outTipsShow"></view></view>//退出填写提示框......
  • uniapp 使用 qrcode.js 生成二维码只显示一次
    使用qrcode.js生成二维码canvas画布不能用v-if要用v-show......
  • Qt最基本的布局,创建window界面
    #include"mainwindow.h"#include<QMenuBar>#include<QToolBar>#include<QStatusBar>#include<QLabel>#include<QDockWidget>#include<QTextEdit>MainWindow::MainWin......
  • 桌面应用布局图
    ......
  • qml教程-3-锚点anchor布局
    importQtQuick2.15Window{width:400height:600visible:trueRectangle{anchors.fill:parentcolor:'yellowgreen'}}importQtQuick......
  • SAP 布局编辑器无法使用问题处理
    因一些事情,公司将正式系统的数据拷贝到了开发机,后来在开发中用到了布局编辑器,发现打不开且会报错RFCcallbackcallrejectedbywhitelist这个是因为正式机和开发机有......
  • uniapp--微信小程序 问题记录
    自动适配问题rem适配为什么选择rema)机型太多,不同的机型屏幕大小不一样b)需求:一套设计稿的内容在不同的机型上呈现的效果一致,根据屏幕大小不同的变化,页面中的内......
  • CSS布局
    传统网页布局的三种方式标准流/普通流/文档流(块级元素独占一行,从上往下排列,行内元素从左到右按顺序排列)浮动定位多个块元素纵向排列用标准流,多个块元素横向排列用浮......
  • QT——代码布局
    #include"w_titlebarwidget.h"#include<QLabel>#include<QToolButton>#include<QHBoxLayout>#include<QDesktopWidget>#include<QApplication>#include<QDeb......
  • 编译 flex 报段错误
    1.修改host-flex-2.6.4/configure.ac:@@-25,8+25,10@@ #autoconfrequirementsandinitialization AC_INIT([thefastlexicalanalysergenerator],[2.6.4],[f......