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

相关推荐
Dxy12393102164 分钟前
Python检查JSON格式错误的多种方法
前端·python·json
chao-Cyril25 分钟前
从入门到进阶:前端开发的成长之路与实战感悟
前端·javascript·vue.js
shalou290141 分钟前
Spring 核心技术解析【纯干货版】- Ⅶ:Spring 切面编程模块 Spring-Instrument 模块精讲
前端·数据库·spring
大时光1 小时前
js 封装 动画效果
前端
大时光1 小时前
html翻页时钟 效果
前端
大猫子的技术日记1 小时前
2025 AI Agent 开发实战指南:从上下文工程到多智能体协作
前端·人工智能·bootstrap
前端达人1 小时前
被JavaScript忽视的Web Animations API:为什么说它是前端动画的真正未来?
开发语言·前端·javascript·ecmascript
忧郁的橙子.1 小时前
04-从零搭建本地AI对话系统:Ollama + DeepSeek-R1:7B + Streamlit
前端·chrome
PTC2 小时前
做了个 EPUB 阅读器,被「阅读进度同步」折磨了一周,总结 4 个血泪教训
前端
Aaron_Feng2 小时前
适配Swift 6 Sendable:用AALock优雅解决线程安全与不可变引用难题
前端