feat: 引入prettier

This commit is contained in:
2025-06-29 08:32:17 +08:00
parent dfc817e3e3
commit cae0fe371b
29 changed files with 447 additions and 316 deletions

View File

@@ -2,41 +2,34 @@
export const matchMedia = (
type: "sm" | "md" | "lg" | string,
matchFunc?: Function,
mismatchFunc?: Function,
mismatchFunc?: Function
) => {
if (type === "sm") {
if (window.matchMedia("(max-width: 767.98px)").matches) {
/* 窗口小于或等于 */
matchFunc?.();
}
else {
} else {
mismatchFunc?.();
}
}
else if (type === "md") {
} else if (type === "md") {
if (window.matchMedia("(max-width: 992px)").matches) {
/* 窗口小于或等于 */
matchFunc?.();
}
else {
} else {
mismatchFunc?.();
}
}
else if (type === "lg") {
} else if (type === "lg") {
if (window.matchMedia("(max-width: 1200px)").matches) {
/* 窗口小于或等于 */
matchFunc?.();
}
else {
} else {
mismatchFunc?.();
}
}
else {
} else {
if (window.matchMedia(`(max-width: ${type}px)`).matches) {
/* 窗口小于或等于 */
matchFunc?.();
}
else {
} else {
mismatchFunc?.();
}
}