Skip to content

Dialog 对话框 ​

Feedback · Interactive component

Confirmation and cancellation dialogs.

On-demand importwbbb-ui/components/dialog

Basic Usage ​

Example code
<script setup lang="ts">
import { showDialog } from 'wbbb-ui/services/dialog'

function open() { showDialog('Saved successfully') }
</script>

<template><button @click="open">Open Dialog</button></template>
Live mobile previewOpen in a new tab ↗

States and Interaction ​

All listed states can be operated and verified in the live Playground preview.

DefaultPressed选中Disabled

Service components use <wbbb-overlay-host /> for library visuals and fall back to uni-app native capability without a host.

API Reference ​

Props

PropertyDescriptionTypeDefaultRequired
cancelTextOverrides the cancel action label.string由 locale 决定No
confirmTextOverrides the confirm action label.string由 locale 决定No
contentProvides the main text content of the component.string''No
localeOverrides the locale used for built-in display copy.WbbbLocaleInput—No
modelValueProvides the current value used by v-model.booleanfalseNo
showCancelControls whether the cancel action is shown.booleantrueNo
titleSets the component title text.string''No

Events

  • update:modelValue
  • cancel
  • close
  • confirm

Slots

  • default

Two-way binding

Supports v-model (modelValue).

Platform Notes ​

Build verification: H5, App Vue, WeChat Mini Program, Alipay Mini Program, and Douyin Mini Program.

Runtime differences: H5 supports keyboard focus and reduced motion. Mini Programs provide equivalent touch interaction; verify upload, date selection, and overlays on target platforms.

Usage note: Service APIs can be used without full installation and are queued by Overlay Host.

Wbbb UI · Built for uni-app product experiences