1.0.1 • Published 5 years ago

@taqu/popconfirm v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

popconfirm 气泡确认框

点击元素,弹出气泡式的确认框。

何时使用

目标元素的操作需要用户进一步的确认时,在目标元素附近弹出浮层提示,询问用户。和 ‘confirm’ 弹出的全屏居中模态对话框相比,交互形式更轻量,目标更明确。

代码演示

<template>
  <popconfirm title="确认删除?" okText="确认" cancelText="取消" @confirm="() => onDelete(11)">
    <a href="javascript:void(0);">删除</a>
  </popconfirm>
</template>
<script>
export default {
  methods: {
    onDelete (id) {
      console.log(id)
    }
  }
}
</script>

API

参数说明类型默认值
cancelText取消按钮文字String取消
okText确认按钮文字String确定
title标题String确认执行此操作吗?
placement出现位置(top/top-start/top-end/bottom/bottom-start/bottom-end/left/left-start/left-end/right/right-start/right-end)Stringtop-end
type确认类型(warning/danger)Stringwarning

事件

事件名称说明回调参数
cancel点击取消的回调function(e)
confirm点击确认的回调function(e)
1.0.1

5 years ago

1.0.0

5 years ago