效果展示:
其中其中el-popver的placment属性定义popver弹出框的位置,默认值为bottom
trigger为触发方式,默认为hover
公共代码:
<el-table-column prop="recipient,re_phone,re_address" label="收件人信息" width="160">
<template #default="scope">
<el-popover placement="right" :width="350" trigger="hover">
<template #reference>
<el-button plain>详细信息</el-button>
</template>
<!--设置popover弹窗内容 -->
<el-popover>
</template>
</el-table-column>
引入涉及到element-plus组件模块
import { ElPopover, ElButton} from 'element-plus'
完整代码:
<el-table :data="orderData" style="width: 100%">
<el-table-column fixed prop="time" label="创建时间" width="250" />
<el-table-column prop="order_no" label="订单编号" width="250" />
<el-table-column prop="user_uid" label="用户名" width="160" />
<el-table-column prop="recipient,re_phone,re_address" label="收件人信息" width="160">
<template #default="scope">
<el-popover placement="right" :width="350" trigger="hover">
<template #reference>
<el-button plain>详细信息</el-button>
</template>
<div class="expressInfo">
<el-descriptions title="收件人信息" :column="1">
<el-descriptions-item label="姓名">{{ scope.row.recipient }}</el-descriptions-item>
<el-descriptions-item label="联系电话">{{ scope.row.re_phone }}</el-descriptions-item>
<el-descriptions-item label="邮寄地址">{{ scope.row.re_address }}</el-descriptions-item>
</el-descriptions>
</div>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="order_data" label="订单详情" width="160">
<template #default="scope">
<el-button plain @click="drawerView(scope.row._id, scope.$index)">详细信息</el-button>
</template>
</el-table-column>
<el-table-column prop="order_state" label="订单状态" width="160" />
<el-table-column fixed="right" label="操作" width="160">
<template #default>
<el-button link type="primary" size="small" @click="">编辑</el-button>
<el-button link type="primary" size="small">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->