lint
This commit is contained in:
1 parent
fc250c54ed
commit
5eec516459
62 files changed
+3912
-3376
No files matched your search
@@ -1,36 +1,36 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
import { defineStore } from 'pinia';
|
||||
import { ref } from 'vue';
|
||||
|
||||
export interface SnackbarAction {
|
||||
text: string
|
||||
color?: string
|
||||
handler?: () => void
|
||||
text: string;
|
||||
color?: string;
|
||||
handler?: () => void;
|
||||
}
|
||||
|
||||
export const useSnackbarStore = defineStore('snackbar', () => {
|
||||
const isVisible = ref(false)
|
||||
const message = ref('')
|
||||
const color = ref('info')
|
||||
const timeout = ref(3000)
|
||||
const actions = ref<SnackbarAction[]>([])
|
||||
const isVisible = ref(false);
|
||||
const message = ref('');
|
||||
const color = ref('info');
|
||||
const timeout = ref(3000);
|
||||
const actions = ref<SnackbarAction[]>([]);
|
||||
|
||||
const show = (msg: string, clr = 'info', tout = 3000, actionList: SnackbarAction[] = []) => {
|
||||
message.value = msg
|
||||
color.value = clr
|
||||
timeout.value = tout
|
||||
actions.value = actionList
|
||||
isVisible.value = true
|
||||
}
|
||||
message.value = msg;
|
||||
color.value = clr;
|
||||
timeout.value = tout;
|
||||
actions.value = actionList;
|
||||
isVisible.value = true;
|
||||
};
|
||||
|
||||
const success = (msg: string, tout = 3000) => show(msg, 'success', tout)
|
||||
const error = (msg: string, tout = 3000) => show(msg, 'error', tout)
|
||||
const warning = (msg: string, tout = 3000) => show(msg, 'warning', tout)
|
||||
const info = (msg: string, tout = 3000) => show(msg, 'info', tout)
|
||||
const success = (msg: string, tout = 3000) => show(msg, 'success', tout);
|
||||
const error = (msg: string, tout = 3000) => show(msg, 'error', tout);
|
||||
const warning = (msg: string, tout = 3000) => show(msg, 'warning', tout);
|
||||
const info = (msg: string, tout = 3000) => show(msg, 'info', tout);
|
||||
|
||||
const hide = () => {
|
||||
isVisible.value = false
|
||||
actions.value = []
|
||||
}
|
||||
isVisible.value = false;
|
||||
actions.value = [];
|
||||
};
|
||||
|
||||
return {
|
||||
isVisible,
|
||||
@@ -43,6 +43,6 @@ export const useSnackbarStore = defineStore('snackbar', () => {
|
||||
error,
|
||||
warning,
|
||||
info,
|
||||
hide
|
||||
}
|
||||
})
|
||||
hide,
|
||||
};
|
||||
});
|
||||
Reference in new issue
Block a user