mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-12 21:52:48 +00:00
1
This commit is contained in:
parent
ece94fcd3c
commit
09dc03125d
10
packages/vite-plugin/dist/index.js
vendored
10
packages/vite-plugin/dist/index.js
vendored
@ -493,7 +493,7 @@
|
|||||||
"group-hover:",
|
"group-hover:",
|
||||||
];
|
];
|
||||||
const statePrefixes = ["dark:", "light:", "sm:", "md:", "lg:", "xl:", "2xl:"];
|
const statePrefixes = ["dark:", "light:", "sm:", "md:", "lg:", "xl:", "2xl:"];
|
||||||
if (className.includes("!")) {
|
if (className.startsWith("!") && !className.includes("!=")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
for (const prefix of prefixes) {
|
for (const prefix of prefixes) {
|
||||||
@ -1670,6 +1670,10 @@ if (typeof window !== 'undefined') {
|
|||||||
if (className.includes(":host")) {
|
if (className.includes(":host")) {
|
||||||
return className;
|
return className;
|
||||||
}
|
}
|
||||||
|
// 如果是表达式,则不进行转换
|
||||||
|
if (["!=", "!==", "?", ":", "="].includes(className)) {
|
||||||
|
return className;
|
||||||
|
}
|
||||||
let safeClassName = className;
|
let safeClassName = className;
|
||||||
// 移除转义字符
|
// 移除转义字符
|
||||||
if (safeClassName.includes("\\")) {
|
if (safeClassName.includes("\\")) {
|
||||||
@ -1772,7 +1776,9 @@ if (typeof window !== 'undefined') {
|
|||||||
}
|
}
|
||||||
// 处理 flex-1
|
// 处理 flex-1
|
||||||
if (decl.prop == "flex") {
|
if (decl.prop == "flex") {
|
||||||
decl.value = "1";
|
if (decl.value.startsWith("1")) {
|
||||||
|
decl.value = "1";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 解析声明值
|
// 解析声明值
|
||||||
const parsed = valueParser(decl.value);
|
const parsed = valueParser(decl.value);
|
||||||
|
|||||||
@ -34,6 +34,11 @@ function toSafeClass(className: string): string {
|
|||||||
return className;
|
return className;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果是表达式,则不进行转换
|
||||||
|
if (["!=", "!==", "?", ":", "="].includes(className)) {
|
||||||
|
return className;
|
||||||
|
}
|
||||||
|
|
||||||
let safeClassName = className;
|
let safeClassName = className;
|
||||||
|
|
||||||
// 移除转义字符
|
// 移除转义字符
|
||||||
@ -163,7 +168,9 @@ function postcssPlugin(): Plugin {
|
|||||||
|
|
||||||
// 处理 flex-1
|
// 处理 flex-1
|
||||||
if (decl.prop == "flex") {
|
if (decl.prop == "flex") {
|
||||||
decl.value = "1";
|
if (decl.value.startsWith("1")) {
|
||||||
|
decl.value = "1";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 解析声明值
|
// 解析声明值
|
||||||
|
|||||||
@ -314,7 +314,7 @@ export function isTailwindClass(className: string): boolean {
|
|||||||
|
|
||||||
const statePrefixes = ["dark:", "light:", "sm:", "md:", "lg:", "xl:", "2xl:"];
|
const statePrefixes = ["dark:", "light:", "sm:", "md:", "lg:", "xl:", "2xl:"];
|
||||||
|
|
||||||
if (className.includes("!")) {
|
if (className.startsWith("!") && !className.includes("!=")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user