feat: quasar notify

This commit is contained in:
puriphatt 2024-08-07 04:18:04 +00:00
parent ceb906724c
commit f958714445
4 changed files with 34 additions and 2 deletions

View file

@ -1,4 +1,4 @@
import { Dialog, QSelect } from 'quasar';
import { Dialog, QSelect, Notify, QNotifyCreateOptions } from 'quasar';
import GlobalDialog from 'components/GlobalDialog.vue';
import { ComposerTranslation, useI18n } from 'vue-i18n';
import { defineStore } from 'pinia';
@ -46,6 +46,36 @@ export function dialogWarningClose(
});
}
export function notify(
type: 'create',
message?: string,
opts?: QNotifyCreateOptions | string,
) {
if (type === 'create') {
Notify.create({
icon: 'mdi-check-circle',
iconColor: 'white',
iconSize: '42px',
color: 'positive',
message: message,
position: 'bottom',
timeout: 1000,
group: false,
actions: [
{
icon: 'mdi-close',
color: 'white',
round: true,
handler: () => {},
},
],
});
}
if (opts) {
Notify.create(opts);
}
}
export function moveItemUp(items: unknown[], index: number) {
if (index > 0) {
const temp = items[index];