VButton ​

VButton wraps Element Plus ElButton and adds optional confirmation flows, tooltip wrapping, automatic loading helpers, and leading-edge click debounce.

Basic Usage ​

Use auto-loading to keep the button in loading state until the handler calls done() after an async save finishes.

Call `done()` after the async action finishes.

Confirmation ​

Compare popconfirm for inline confirmation with boxconfirm for dialog-style interruption.

Inline confirmation keeps the action close to the trigger.
Dialog confirmation works better for heavier actions.

Tooltip ​

Use tip-content for quick hints, and tip-config when you need to customize tooltip placement or theme.

Complete example ​

Combine async loading, debounce, tooltip wrapping, and boxconfirm callbacks in a toolbar-style layout.

Debounced async submit
Click rapidly to see the leading debounce.
Tooltip with box confirm
Confirmation result callbacks
Awaiting confirmation result

Behavior Notes ​

  • click and confirm both receive a done() callback. Call it to stop the internal loading states started by auto-loading or auto-full-screen-loading.
  • When confirm-type is 'popconfirm', clicking the button only opens the confirmation popup. The action itself runs after the confirm event fires.
  • When confirm-type is 'boxconfirm', clicking the button opens ElMessageBox.confirm, and cancel is emitted when the dialog is dismissed.
  • debounce accepts true or a number. true uses a 500 ms leading debounce, while a number sets the debounce delay in milliseconds.
  • When tip-content is provided, tip-config is merged on top of { effect: 'dark', placement: 'top', content: tipContent }.
  • tip-content takes precedence over confirm-type="popconfirm" because only one wrapper component is rendered. If you need both tooltip and confirmation, use boxconfirm.
  • Additional attributes such as size, disabled, plain, and icon are forwarded to the inner ElButton.
  • as-el-button only controls the outer v-button wrapper class used by the extended button spacing styles.

API ​

VButton Attributes ​

NameDescriptionTypeDefault
as-el-buttonapply the outer v-button wrapper class for extended spacing stylesbooleantrue
auto-loadingautomatically set the inner button loading state before emitting click or confirmbooleanfalse
auto-full-screen-loadingshow a fullscreen loading mask before emitting click or confirmbooleanfalse
confirm-typeconfirmation mode used before running the actionenumnull
box-configboxconfirm dialog options; currently uses message, title, confirmButtonText, cancelButtonText, and typeobject{}
pop-configprops forwarded to ElPopconfirm when confirm-type="popconfirm"object{ title: '确定删除吗?' }
typebutton type forwarded to ElButtonenumnull
tip-contenttooltip text contentstringnull
tip-configprops merged into the tooltip configobjectnull
loadingmanual loading state for the inner buttonbooleanfalse
debounceenable leading click debounce, or provide the debounce delay in millisecondsboolean / numberfalse

box-config falls back to message: '此操作将永久删除该数据, 是否继续?', title: '提示', confirmButtonText: '确定', cancelButtonText: '取消', and type: 'warning'.

VButton Events ​

NameDescriptionType
clickemitted when the button action runs without confirmationfunction
confirmemitted after the user accepts a popconfirm or boxconfirm actionfunction
cancelemitted when a confirmation flow is dismissedfunction

click is only emitted when confirm-type is not set. Confirmation flows use confirm instead.

VButton Slots ​

NameDescription
defaultbutton content

Source ​

Docs