vue el-table使用、el-popover关闭、el-image大图预览

1、html

html 复制代码
<el-table :data="list" :header-cell-style="{ background: '#F7F8F9' }">
		<el-table-column type="index" width="100px" label="序号"></el-table-column>
        <el-table-column prop="pic" label="图片" width="100">
          <template #default="{ row }">
            <img :src="picUrl + row.img" alt="">
          </template>
        </el-table-column>

		<el-table-column
          v-for="(columnInfo, columnIndex) in tableColumn"
          :key="columnIndex"
          :prop="columnInfo.code"
          :label="columnInfo.label"
          :width="columnInfo.width || 'auto'"
        >
          <template slot-scope="scope">
            {{ scope.row[columnInfo.code] || '-' }}
          </template>
        </el-table-column>

		<el-table-column prop="postInfo" label="运单" align="center" >
           <template slot-scope="scope">
             <span v-html="scope.row.postInfo">
             </span>
           </template>
         </el-table-column>
         <el-table-column v-if="order.orderStatus === '已付款'" prop="operation" label="操作" align="center" width="100">
           <template slot-scope="scope">
             <!-- trigger="hover"  -->
             <el-popover v-show="!scope.row.postNum" ref="popoverRef" placement="bottom">
             <!-- 这里是弹窗弹出来的样式(start)------->
               <div class="pop">
               </div>
             <!-- 这里是弹窗弹出来的样式(end)------->
               <div slot="reference">
               	<!-- 这里是触发弹窗弹出来的样式(start)------->
                 <div class="item-edit">
                 </div>
             		<!-- 这里是触发弹窗弹出来的样式(start)------->
               </div>
             </el-popover>
           </template>
         </el-table-column>
</el-table>             

tableColum 格式

html 复制代码
export const tableColum = [ 
  {
    label: '姓名',
    code: 'name',
    type: 'normal',
    width: '55',
  },
  {
    label: '手机号',
    code: 'tel',
    type: 'template',
  },
]

2、关闭popover

javascript 复制代码
this.$refs.popover.doClose()

3、el-image 图片大图预览-详解

el-image

el-image-view

相关推荐
OEC小胖胖8 小时前
14|Hook 的实现视角:从 API 到 Fiber Update Queue 的连接点
前端·react.js·前端框架·react·开源库
i7i8i9com8 小时前
React 19学习基础-2 新特性
javascript·学习·react.js
军军君018 小时前
Three.js基础功能学习十:渲染器与辅助对象
开发语言·前端·javascript·学习·3d·前端框架·ecmascript
Marshmallowc8 小时前
React useState 数组 push/splice 后页面不刷新?深度解析状态被『蹭』出来的影子更新陷阱
前端·react.js·前端框架
GIS之路8 小时前
ArcGIS Pro 添加底图的方式
前端·数据库·python·arcgis·信息可视化
Mo_jon8 小时前
vite + vue 快速构建 html 页面 (舒适编写html文件)
前端·vue.js·html
步步为营DotNet8 小时前
深度解析.NET 中Nullable<T>:灵活处理可能为空值的类型
java·前端·.net
VT.馒头8 小时前
【力扣】2631. 分组
javascript·算法·leetcode·typescript
许同8 小时前
JS-WPS 自动化办公(3)数据整理-找数据
开发语言·javascript·wps
rqtz8 小时前
前端相关动画库(GSAP/Lottie/Swiper/AOS)
前端·swiper·lottie·gsap·aos·font-awsome