mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-10 20:02:54 +00:00
更新
This commit is contained in:
parent
5535535439
commit
3cf7ee003e
9
packages/vite-plugin/dist/index.js
vendored
9
packages/vite-plugin/dist/index.js
vendored
@ -2148,10 +2148,6 @@ if (typeof window !== 'undefined') {
|
||||
return;
|
||||
}
|
||||
let _node = node;
|
||||
// 兼容 <input /> 标签
|
||||
if (_node.startsWith("<input")) {
|
||||
_node = _node.replace("/>", "</input>");
|
||||
}
|
||||
// uniappx 插件模式
|
||||
if (!config.uniapp.isPlugin) {
|
||||
// 为 text 节点添加暗黑模式文本颜色
|
||||
@ -2192,7 +2188,10 @@ if (typeof window !== 'undefined') {
|
||||
const hasDynamicClass = _node.includes(":class=");
|
||||
// 如果没有动态类名,添加空的动态类名绑定
|
||||
if (!hasDynamicClass) {
|
||||
_node = _node.slice(0, -1) + ` :class="{}"` + ">";
|
||||
// 优化写法,避免重复字符串拼接
|
||||
const insertIndex = _node.length - (_node.endsWith("/>") ? 2 : 1);
|
||||
_node =
|
||||
_node.slice(0, insertIndex) + ` :class="{}"` + _node.slice(insertIndex);
|
||||
}
|
||||
// 获取暗黑模式类名
|
||||
let darkClassNames = classNames.filter((name) => name.startsWith("dark-colon-"));
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cool-vue/vite-plugin",
|
||||
"version": "8.2.12",
|
||||
"version": "8.2.13",
|
||||
"description": "cool-admin、cool-uni builder",
|
||||
"types": "./dist/index.d.ts",
|
||||
"main": "/dist/index.js",
|
||||
|
||||
@ -282,11 +282,6 @@ function transformPlugin(): Plugin {
|
||||
|
||||
let _node = node;
|
||||
|
||||
// 兼容 <input /> 标签
|
||||
if (_node.startsWith("<input")) {
|
||||
_node = _node.replace("/>", "</input>");
|
||||
}
|
||||
|
||||
// uniappx 插件模式
|
||||
if (!config.uniapp.isPlugin) {
|
||||
// 为 text 节点添加暗黑模式文本颜色
|
||||
@ -332,7 +327,11 @@ function transformPlugin(): Plugin {
|
||||
|
||||
// 如果没有动态类名,添加空的动态类名绑定
|
||||
if (!hasDynamicClass) {
|
||||
_node = _node.slice(0, -1) + ` :class="{}"` + ">";
|
||||
// 优化写法,避免重复字符串拼接
|
||||
const insertIndex = _node.length - (_node.endsWith("/>") ? 2 : 1);
|
||||
|
||||
_node =
|
||||
_node.slice(0, insertIndex) + ` :class="{}"` + _node.slice(insertIndex);
|
||||
}
|
||||
|
||||
// 获取暗黑模式类名
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user