This commit is contained in:
icssoa 2025-10-17 22:11:10 +08:00
parent 732000aec4
commit fd60485179
5 changed files with 18 additions and 23 deletions

View File

@ -2012,8 +2012,14 @@ if (typeof window !== 'undefined') {
return { return {
// 处理选择器规则 // 处理选择器规则
Rule(rule) { Rule(rule) {
if (rule.selector.includes("uni-") || if ([
[".button-hover"].some((e) => rule.selector.includes(e))) { ".button-hover",
":deep(",
"&::",
":is(",
"uni-",
".uni-",
].some((e) => rule.selector.includes(e))) {
return; return;
} }
// 转换选择器为安全的类名格式 // 转换选择器为安全的类名格式

View File

@ -1,6 +1,6 @@
{ {
"name": "@cool-vue/vite-plugin", "name": "@cool-vue/vite-plugin",
"version": "8.2.14", "version": "8.2.17",
"description": "cool-admin、cool-uni builder", "description": "cool-admin、cool-uni builder",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
"main": "/dist/index.js", "main": "/dist/index.js",

View File

@ -1,9 +1,7 @@
import type { Plugin } from "vite"; import type { Plugin } from "vite";
import { SAFE_CHAR_MAP_LOCALE } from "./config"; import { SAFE_CHAR_MAP_LOCALE } from "./config";
import { createCtx } from "../ctx"; import { createCtx } from "../ctx";
import { compareVersion, readFile, rootDir } from "../utils"; import { readFile, rootDir } from "../utils";
import { createEps } from "../eps";
import { uniq } from "lodash";
// 获取 tailwind.config.ts 中的颜色 // 获取 tailwind.config.ts 中的颜色
function getTailwindColor() { function getTailwindColor() {

View File

@ -1,18 +1,5 @@
import { firstUpperCase } from "../utils"; import { firstUpperCase } from "../utils";
/**
*
* @interface ParseResult
*/
interface ParseResult {
/** 解析出的键名 */
key: string;
/** 解析出的内容 */
content: string;
/** 层级 */
level: number;
}
/** /**
* Service * Service
* @param template - Service * @param template - Service

View File

@ -98,10 +98,14 @@ function postcssPlugin(): Plugin {
// 处理选择器规则 // 处理选择器规则
Rule(rule: any) { Rule(rule: any) {
if ( if (
rule.selector.includes("uni-") || [
[".button-hover"].some((e) => ".button-hover",
rule.selector.includes(e), ":deep(",
) "&::",
":is(",
"uni-",
".uni-",
].some((e) => rule.selector.includes(e))
) { ) {
return; return;
} }