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

相关推荐
古一|7 分钟前
Vue3中ref与reactive实战指南:使用场景与代码示例
开发语言·javascript·ecmascript
peachSoda79 分钟前
封装一个不同跳转方式的通用方法(跳转外部链接,跳转其他小程序,跳转半屏小程序)
前端·javascript·微信小程序·小程序
@PHARAOH21 分钟前
HOW - 浏览器兼容(含 Safari)
前端·safari
undefined在掘金3904131 分钟前
flutter 仿商场_首页
前端
少卿31 分钟前
react-native图标替换
前端·react native
熊猫钓鱼>_>37 分钟前
TypeScript前端架构与开发技巧深度解析:从工程化到性能优化的完整实践
前端·javascript·typescript
敲敲敲敲暴你脑袋39 分钟前
Canvas绘制自定义流动路径
vue.js·typescript·canvas
JYeontu1 小时前
肉眼难以分辨 UI 是否对齐,写个插件来辅助
前端·javascript
fox_1 小时前
别再踩坑!JavaScript的this关键字,一次性讲透其“变脸”真相
前端·javascript
盛夏绽放1 小时前
uni-app Vue 项目的规范目录结构全解
前端·vue.js·uni-app