This commit is contained in:
Viet An
2026-05-14 09:11:18 +07:00
parent 336c8c9036
commit 4d37397ee4
25 changed files with 450 additions and 209 deletions

View File

@@ -20,12 +20,17 @@ export default defineNuxtPlugin((nuxtApp) => {
const { $id, $empty, $store } = nuxtApp;
const dialog = function (content, title, type, duration, width, height, vbind) {
content = typeof content === "string" ? content : JSON.stringify(content);
let vtitle = type === "Success" ? `<span class="has-text-primary">${title}</span>` : title;
if (type === "Error") vtitle = `<span class="has-text-danger">${title}</span>`;
const vtitle =
type === "Success"
? `<span class="has-text-primary">${title}</span>`
: type === "Error"
? `<span class="has-text-danger">${title}</span>`
: title;
let data = {
id: $id(),
component: `dialog/${type || "Info"}`,
vbind: { content: content, duration: duration, vbind: vbind },
vbind: { content, duration, vbind },
title: vtitle,
width: width || "600px",
height: height || "100px",