modal change

This commit is contained in:
熊潇 2024-09-29 01:40:16 +08:00
parent 36f865b026
commit 66aae218f3
4 changed files with 69 additions and 7 deletions

View File

@ -34,7 +34,7 @@ export const useDemoStore = create<DemoStore>((set, get) => {
if (res.code === 200) { if (res.code === 200) {
set({ list: res.data }); set({ list: res.data });
} else { } else {
message.error(res.msg || 'Request failed'); message.error(res.message || 'Request failed');
} }
}, },
updateData: async (data) => { updateData: async (data) => {
@ -49,7 +49,7 @@ export const useDemoStore = create<DemoStore>((set, get) => {
set({ showEdit: false, formData: [] }); set({ showEdit: false, formData: [] });
getList(); getList();
} else { } else {
message.error(res.msg || 'Request failed'); message.error(res.message || 'Request failed');
} }
}, },
deleteData: async (id) => { deleteData: async (id) => {
@ -63,7 +63,7 @@ export const useDemoStore = create<DemoStore>((set, get) => {
getList(); getList();
message.success('Success'); message.success('Success');
} else { } else {
message.error(res.msg || 'Request failed'); message.error(res.message || 'Request failed');
} }
}, },
}; };

View File

@ -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;
}
}

View File

@ -7,9 +7,10 @@
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"files": [ "files": [
"plugins" "plugins",
"css"
], ],
"keywords": [], "keywords": [],
"author": "", "author": "abearxiong",
"license": "ISC" "license": "ISC"
} }

View File

@ -105,8 +105,8 @@ export class Modal<T = any, U = KV> {
return _root; return _root;
} }
static render<T extends new (...args: any[]) => any>(this: T,el: string | HTMLDivElement, id: string, opts?: ModalOpts): InstanceType<T>; static render<T extends new (...args: any[]) => any>(this: T,el: string | HTMLDivElement, id: string, opts?: ConstructorParameters<T>[0]): InstanceType<T>;
static render<T extends new (...args: any[]) => any>(this: T,el: string | HTMLDivElement, opts?: ModalOpts): InstanceType<T>; static render<T extends new (...args: any[]) => any>(this: T,el: string | HTMLDivElement, opts?: ConstructorParameters<T>[0]): InstanceType<T>;
static render(...args: any[]) { static render(...args: any[]) {
let [el, id, opts] = args; let [el, id, opts] = args;
const _el = querySelector(el); const _el = querySelector(el);