Skip to content

ConfirmView 确认弹窗

按钮在底部

html
<vz-button @click="handleShow" block>打开弹窗</vz-button>

<vz-confirm-view v-model:show="isShow" radius="20rpx">
  <view class="confirm-view">内容</view>
</vz-confirm-view>
typescript
import { ref } from "vue";

const isShow = ref(false);
function handleShow() {
  isShow.value = true;
}

按钮在底部

html
<vz-button @click="handleShow" block>打开弹窗</vz-button>

<vz-confirm-view v-model:show="isShow" mode="header" radius="20rpx">
  <view class="confirm-view">内容</view>
</vz-confirm-view>
typescript
import { ref } from "vue";

const isShow = ref(false);
function handleShow() {
  isShow.value = true;
}

弹窗标题

html
<vz-button @click="handleShow" block>打开弹窗</vz-button>

<vz-confirm-view v-model:show="isShow" title="弹窗标题" radius="20rpx">
  <view class="confirm-view">内容</view>
</vz-confirm-view>
typescript
import { ref } from "vue";

const isShow = ref(false);
function handleShow() {
  isShow.value = true;
}

Props

属性名说明类型默认值
show是否显示确认弹窗booleanfalse
mode按钮位置header \ footerfooter
header-border是否显示顶部下边框booleantrue
title标题string-
confirm-text确定按钮文案string确定
cancel-text取消按钮文案string取消
confirm-type确定按钮类型ButtonType-
cancel-type取消按钮类型ButtonType-
confirm-color确定按钮颜色string-
cancel-color取消按钮颜色string-
button-width按钮宽度string \ numberauto \ 240rpx
button-height按钮高度。仅按钮在底部时生效string \ numberButton.height
button-text-weight按钮字体加粗number \ string600
z-indexz-indexnumber \ stringPopup.zIndex
radius弹窗圆角string \ number0
overlay-closeable点击遮罩层是否关闭弹窗booleantrue
safe-area-inset-bottom是否开启底部安全区适配booleanPopup.safeAreaInsetBottom
auto-close点击确认/取消按钮时是否关闭弹窗booleantrue
i-class根节点样式类string-
i-style根节点样式Vue.CSSProperties-

Events

事件名说明参数
confirm点击确定按钮事件-
cancel点击取消按钮事件-

Slots

插槽名说明
header顶部插槽
footer底部插槽

CSS

变量名说明默认值
--confirm-view-header-height顶部高度90rpx
--confirm-view-header-border-color顶部下边框颜色--vz-border-color
--confirm-view-title-padding-x标题 padding-x20rpx
--confirm-view-title-text-weight标题字体加粗600
--confirm-view-footer-padding底部 padding20rpx 20rpx 70rpx
--confirm-view-button-gap底部按钮间距40rpx

SCSS

scss
$confirm-view: (
  "header-height": 90rpx,
  "header-border-color": getCssVar("border-color"),
  "title-padding-x": 20rpx,
  "title-text-weight": 600,
  "footer-padding": 20rpx 20rpx 70rpx,
  "button-gap": 40rpx,
);