changes
This commit is contained in:
@@ -39,25 +39,13 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
$store.commit("showmodal", data);
|
||||
};
|
||||
|
||||
const snackbar = function (content, title, type, width, height) {
|
||||
content = typeof content == "string" ? content : JSON.stringify(content);
|
||||
|
||||
const vtitle =
|
||||
type === "Success"
|
||||
? `<span class="has-text-primary">${title}</span>`
|
||||
: type === "Error"
|
||||
? `<span class="has-text-danger">${title}</span>`
|
||||
: title;
|
||||
|
||||
const data = {
|
||||
id: $id(),
|
||||
component: type || "Info",
|
||||
vbind: { content },
|
||||
title: vtitle,
|
||||
width: width || "600px",
|
||||
height: height || "100px",
|
||||
};
|
||||
$store.commit("snackbar", data);
|
||||
const snackbar = function (content, component = "Info") {
|
||||
$store.commit("snackbar", {
|
||||
component,
|
||||
vbind: {
|
||||
content: typeof content == "string" ? content : JSON.stringify(content),
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const getLink = function (val) {
|
||||
|
||||
@@ -1227,8 +1227,8 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
}
|
||||
if (notify !== false) {
|
||||
$store.lang === "en"
|
||||
? $snackbar("Data has been successfully saved to the system.", "Success", "Success")
|
||||
: $snackbar("Dữ liệu đã được lưu vào hệ thống", "Thành công", "Success");
|
||||
? $snackbar("Data has been successfully saved to the system.", "Success")
|
||||
: $snackbar("Dữ liệu đã được lưu vào hệ thống", "Success");
|
||||
}
|
||||
return rs;
|
||||
} catch (err) {
|
||||
@@ -1264,8 +1264,8 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
}
|
||||
if (notify !== false) {
|
||||
$store.lang === "en"
|
||||
? $snackbar("Data has been successfully saved to the system.", "Success", "Success")
|
||||
: $snackbar("Dữ liệu đã được lưu vào hệ thống", "Thành công", "Success");
|
||||
? $snackbar("Data has been successfully saved to the system.", "Success")
|
||||
: $snackbar("Dữ liệu đã được lưu vào hệ thống", "Success");
|
||||
}
|
||||
return rs;
|
||||
} catch (err) {
|
||||
@@ -1289,8 +1289,8 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
|
||||
if (notify !== false) {
|
||||
$store.lang === "en"
|
||||
? $snackbar("Data has been successfully saved to the system.", "Success", "Success")
|
||||
: $snackbar("Dữ liệu đã được lưu vào hệ thống", "Thành công", "Success");
|
||||
? $snackbar("Data has been successfully saved to the system.", "Success")
|
||||
: $snackbar("Dữ liệu đã được lưu vào hệ thống", "Success");
|
||||
}
|
||||
return rs;
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user