el-popover或el-popconfirm中button不展示问题

vue3在使用Element-plus 2.X时,出现el-popover或el-popconfirm中button不展示问题。

正常效果:

第一种错误原因:el-button没有添加 slot='reference'

<template slot-scope="scope">
	<el-popconfirm title="您确定删除吗?" @onConfirm="cancelOrder(scope.row.id)">
	    <el-button >删除</el-button>
	</el-popconfirm>
</template>

第二种错误方式: 添加 slot='reference'  还是不展示,没想到吧!!!!!2.3.9官网就是这么写的啊

<el-popover
        placement="top"
        width="200"
        v-model="scope.row.visible">
    <p>确定删除吗?</p>
    <div style="text-align: right; margin: 0">
        <el-button type="text" @click="scope.row.visible= false">取消</el-button>
        <el-button type="text" @click="delete(scope.row.id)">确定</el-button>
    </div>
    <el-button slot="reference">删除</el-button>
</el-popover>

正确方式:

<el-popover
        placement="top"
        width="200"
        v-model="scope.row.visible">
    <p>确定删除吗?</p>
    <div style="text-align: right; margin: 0">
        <el-button type="text" @click="scope.row.visible= false">取消</el-button>
        <el-button type="text" @click="delete(scope.row.id)">确定</el-button>
    </div>
    <template #reference>
        <el-button >删除</el-button>
    </template>
</el-popover>

相关推荐

  1. el-table-column叠加el-popover使用

    2024-07-13 09:06:04       31 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-13 09:06:04       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-13 09:06:04       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-13 09:06:04       58 阅读
  4. Python语言-面向对象

    2024-07-13 09:06:04       69 阅读

热门阅读

  1. 【python】函数重构

    2024-07-13 09:06:04       27 阅读
  2. 服务端生成RSA密钥实例

    2024-07-13 09:06:04       24 阅读
  3. Python面试题:解释一下什么是 `__new__` 方法

    2024-07-13 09:06:04       26 阅读
  4. linux UDP通讯:接口函数&示例

    2024-07-13 09:06:04       23 阅读
  5. Python实现文件访问和加密GUI应用程序

    2024-07-13 09:06:04       19 阅读
  6. 【Docker 系列】学习路线

    2024-07-13 09:06:04       18 阅读
  7. 奖励关(概率dp+状压)

    2024-07-13 09:06:04       20 阅读
  8. QT获得本地IP以及MAC地址

    2024-07-13 09:06:04       22 阅读