本文:饿了么UI/element Popconfirm气泡确认框 confirm/cancel事件
饿了么官网说:
属性Attributes
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
title | 标题 | String | — | — |
confirm-button-text | 确认按钮文字 | String | — | — |
cancel-button-text | 取消按钮文字 | String | — | — |
confirm-button-type | 确认按钮类型 | String | — | Primary |
cancel-button-type | 取消按钮类型 | String | — | Text |
icon | Icon | String | — | el-icon-question |
icon-color | Icon 颜色 | String | — | #f90 |
hide-icon | 是否隐藏 Icon | Boolean | — | false |
¶插槽Slot
参数 | 说明 |
---|---|
reference | 触发 Popconfirm 显示的 HTML 元素 |
方法Events
事件名称 | 说明 | 回调参数 |
---|---|---|
confirm | 点击确认按钮时触发 | — |
cancel | 点击取消按钮时触发 | — |
很多人会发现,不知道怎么用,或者用不了,
废话不多说:上代码:
方法必须是 @onConfirm="successconfirm()"
@onCancel="successcancel()"
不这样就无法使用方法:
<!-- 通过弹框 -->
<el-popconfirm
confirm-button-text="确认"
cancel-button-text="取消"
@onConfirm="successconfirm()"
@onCancel="successcancel()"
icon="el-icon-info"
icon-color="red"
title="您确定通过吗?"
>
<el-button
slot="reference"
type="success"
>通过</el-button
>
</el-popconfirm>
<!-- 通过弹框 -->
风尚云网程序员导航站: