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