From 66aae218f3962f2e5ab8f22f3a463b74d5e17362 Mon Sep 17 00:00:00 2001 From: xion Date: Sun, 29 Sep 2024 01:40:16 +0800 Subject: [PATCH] modal change --- .../react-components/apps/base/store/index.ts | 6 +- packages/tailwind/css/globals.css | 61 +++++++++++++++++++ packages/tailwind/package.json | 5 +- packages/ui/src/components/modal/modal.ts | 4 +- 4 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 packages/tailwind/css/globals.css diff --git a/packages/react-components/apps/base/store/index.ts b/packages/react-components/apps/base/store/index.ts index 08c035e..599f603 100644 --- a/packages/react-components/apps/base/store/index.ts +++ b/packages/react-components/apps/base/store/index.ts @@ -34,7 +34,7 @@ export const useDemoStore = create((set, get) => { if (res.code === 200) { set({ list: res.data }); } else { - message.error(res.msg || 'Request failed'); + message.error(res.message || 'Request failed'); } }, updateData: async (data) => { @@ -49,7 +49,7 @@ export const useDemoStore = create((set, get) => { set({ showEdit: false, formData: [] }); getList(); } else { - message.error(res.msg || 'Request failed'); + message.error(res.message || 'Request failed'); } }, deleteData: async (id) => { @@ -63,7 +63,7 @@ export const useDemoStore = create((set, get) => { getList(); message.success('Success'); } else { - message.error(res.msg || 'Request failed'); + message.error(res.message || 'Request failed'); } }, }; diff --git a/packages/tailwind/css/globals.css b/packages/tailwind/css/globals.css new file mode 100644 index 0000000..9e091dc --- /dev/null +++ b/packages/tailwind/css/globals.css @@ -0,0 +1,61 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@layer base { + html, + body { + width: 100%; + height: 100%; + font-size: 16px; + font-family: 'Montserrat', sans-serif; + } + h1 { + @apply text-2xl font-bold; + } + h2 { + @apply text-xl font-bold; + } + h3 { + @apply text-lg font-bold; + } +} + +@layer components { + .btn { + @apply bg-blue-500 text-white font-bold py-2 px-4 rounded; + } + .card { + @apply bg-white shadow-md rounded-lg p-4; + .card-title { + @apply text-lg font-bold; + } + .card-subtitle { + @apply text-sm text-gray-500; + } + .card-description { + @apply text-gray-700 break-words; + } + .card-code { + @apply bg-gray-100 p-2; + } + .card-body { + @apply text-gray-700; + } + .card-key { + @apply text-xs text-gray-400; + } + .card-footer { + @apply text-sm text-gray-500; + } + } +} + +@layer utilities { + .layout-menu { + @apply bg-gray-900 p-2 text-white flex justify-between h-12; + } + .bg-custom-blue { + background-color: #3490dc; + } +} \ No newline at end of file diff --git a/packages/tailwind/package.json b/packages/tailwind/package.json index 2db898d..a090d6d 100644 --- a/packages/tailwind/package.json +++ b/packages/tailwind/package.json @@ -7,9 +7,10 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "files": [ - "plugins" + "plugins", + "css" ], "keywords": [], - "author": "", + "author": "abearxiong", "license": "ISC" } \ No newline at end of file diff --git a/packages/ui/src/components/modal/modal.ts b/packages/ui/src/components/modal/modal.ts index 73af023..29410ff 100644 --- a/packages/ui/src/components/modal/modal.ts +++ b/packages/ui/src/components/modal/modal.ts @@ -105,8 +105,8 @@ export class Modal { return _root; } - static render any>(this: T,el: string | HTMLDivElement, id: string, opts?: ModalOpts): InstanceType; - static render any>(this: T,el: string | HTMLDivElement, opts?: ModalOpts): InstanceType; + static render any>(this: T,el: string | HTMLDivElement, id: string, opts?: ConstructorParameters[0]): InstanceType; + static render any>(this: T,el: string | HTMLDivElement, opts?: ConstructorParameters[0]): InstanceType; static render(...args: any[]) { let [el, id, opts] = args; const _el = querySelector(el);