This commit is contained in:
Viet An
2026-07-01 11:08:24 +07:00
parent 68872d3f06
commit 0051de6f2c
25 changed files with 49 additions and 71 deletions

View File

@@ -18,7 +18,8 @@ dayjs.locale("vi");
export default defineNuxtPlugin((nuxtApp) => {
const route = useRoute();
const { $id, $empty, $store } = nuxtApp;
const store = useStore();
const { $id, $empty } = nuxtApp;
const dialog = function (content, title, type, duration, width, height, vbind) {
content = typeof content === "string" ? content : JSON.stringify(content);
@@ -38,11 +39,11 @@ export default defineNuxtPlugin((nuxtApp) => {
height: height || "100px",
};
$store.commit("showmodal", data);
store.commit("showmodal", data);
};
const snackbar = function (content, component = "Info") {
$store.commit("snackbar", {
store.commit("snackbar", {
component,
vbind: {
content: typeof content === "string" ? content : JSON.stringify(content),
@@ -315,8 +316,8 @@ export default defineNuxtPlugin((nuxtApp) => {
};
const lang = function (code) {
let field = $store.common.find((v) => v.code === code);
return field ? field[$store.lang] : "";
let field = store.common.find((v) => v.code === code);
return field ? field[store.lang] : "";
};
const createMeta = function (metainfo) {