ftxAlert
Shows an alert dialog with an OK button.
Parameters
options(Object | String) - Alert options or message stringmessage(String) - Alert message (required if options is object)title(String) - Alert title (default: 'Alert')icon(String) - Icon to display (default: 'check')okLabel(String) - Label for OK button (default: 'Yes')$q(Object) - Optional Quasar instance (for use outside Vue components)
Returns
Dialog instance with event handlers:
onOk(callback)- Called when OK button clickedonCancel(callback)- Called when Cancel clicked/dismissedonDismiss(callback)- Called on any dismissal (OK or Cancel)
Usage
Simple Usage
javascript
import { ftxAlert } from '@ftx/ui';
ftxAlert('Operation completed successfully!');With Options
javascript
import { ftxAlert } from '@ftx/ui';
ftxAlert({
title: 'Success',
message: 'Your changes have been saved.',
icon: 'check_circle',
okLabel: 'OK'
}).onOk(() => {
console.log('User clicked OK');
});With Callbacks
javascript
import { ftxAlert } from '@ftx/ui';
ftxAlert({
title: 'Information',
message: 'Please review the changes.',
icon: 'info'
})
.onOk(() => {
console.log('User confirmed');
})
.onDismiss(() => {
console.log('Dialog dismissed');
});