Last active
February 11, 2022 07:22
-
-
Save skushnerchuk/18d8a5f1b6cc1eb7c9025b3b748ecbd9 to your computer and use it in GitHub Desktop.
Quasar v2 dialog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { boot } from 'quasar/wrappers' | |
| export default boot(({ app }) => { | |
| const $q = app.config.globalProperties.$q | |
| app.config.globalProperties.showDialog = (options) => { | |
| return new Promise((resolve, reject) => { | |
| $q.dialog(options).onOk((data) => { | |
| resolve({ | |
| ok: true, | |
| data: data | |
| }) | |
| }).onCancel(() => { | |
| resolve({ ok: false }) | |
| }).onDismiss(() => { | |
| resolve({ ok: false }) | |
| }) | |
| }) | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const result = await this.showDialog({ | |
| component: ShareDialog, | |
| componentProps: { | |
| email: user.user_guest.email, | |
| write: (user.permissions & 1) === 1, | |
| disableInput: true, | |
| title: 'Permissions:' | |
| } | |
| }) | |
| if (!result.ok) { | |
| return | |
| } | |
| const requestBody = { | |
| calc_id: [calcId.value], | |
| email: result.data.email, | |
| permissions: result.data.permissions | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment