-
vuejs-confirm-dialog
Makes simple to create, reuse, promisify and build chains of modal dialogs in Vue.js
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
It would be useful to create a function that would take a dialog component and control its rendering in the template. The function would return an object containing the state of the dialog and methods, so that it could be possible to work with it like with promises. For example, this plugin vue-modal-dialogs implements this functionality. Unfortunately, it has not been updated for a long time and does not support Vue 3.
In this guide I will introduce the vuejs-confirm-dialog plugin and show how to use it. I'll start with simple examples and end up with a function which completely abstracts the popup dialog to confirm an action and can be used in any component of your project. The examples are written in JavaScript for easy reading, but the plugin itself is in TypeScript. The plugin is fully typed and documented, which makes it much easier to work with it. Unlike vue-modal-dialogs, this plugin has additional functionality - special hooks: onConfirm and onCancel. They accept a callback and are called depending on the user's decision: onConfirm if the user agrees and onCancel if he refuses.
Related posts
-
Ask HN: Those of you who don't use AWS/Azure/GCP, what do you use for hosting?
-
Express 5.0 – Last Push
-
RefactAI: Use best-in-class LLMs for coding in your IDE
-
Show HN: Lightweight, React IDE component which runs user written Python code
-
Close-Circuit Telegram Vision Location Tracking with Telegram API Integration