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
e70978579d
commit
4febef7f09
10
packages/vite-plugin/dist/index.js
vendored
10
packages/vite-plugin/dist/index.js
vendored
@ -688,7 +688,7 @@
|
||||
});
|
||||
}
|
||||
// test();
|
||||
// npx ./src/uniapp-x/utils.ts
|
||||
// npx tsx src/uniapp-x/utils.ts
|
||||
|
||||
// 全局 service 对象,用于存储服务结构
|
||||
const service = {};
|
||||
@ -2056,7 +2056,7 @@ if (typeof window !== 'undefined') {
|
||||
classNames.forEach((name, index) => {
|
||||
if (isTailwindClass(name)) {
|
||||
const safeName = toSafeClass(name);
|
||||
_node = _node.replace(name, safeName);
|
||||
_node = _node.replaceAll(name, safeName);
|
||||
classNames[index] = safeName;
|
||||
}
|
||||
});
|
||||
@ -2071,7 +2071,7 @@ if (typeof window !== 'undefined') {
|
||||
// 生成暗黑模式类名的动态绑定
|
||||
const darkClassContent = darkClassNames
|
||||
.map((name) => {
|
||||
_node = _node.replace(name, "");
|
||||
_node = _node.replaceAll(name, "");
|
||||
return `'${name}': __isDark`;
|
||||
})
|
||||
.join(",");
|
||||
@ -2083,7 +2083,7 @@ if (typeof window !== 'undefined') {
|
||||
const v = dynamicClassContent_1[0] +
|
||||
(darkClassContent ? `${darkClassContent},` : "") +
|
||||
dynamicClassContent_1.substring(1);
|
||||
_node = _node.replace(dynamicClassContent_1, v);
|
||||
_node = _node.replaceAll(dynamicClassContent_1, v);
|
||||
}
|
||||
// 处理数组形式的动态类名
|
||||
const dynamicClassContent_2 = classContents.find((content) => content.startsWith("[") && content.endsWith("]"));
|
||||
@ -2091,7 +2091,7 @@ if (typeof window !== 'undefined') {
|
||||
const v = dynamicClassContent_2[0] +
|
||||
`{${darkClassContent}},` +
|
||||
dynamicClassContent_2.substring(1);
|
||||
_node = _node.replace(dynamicClassContent_2, v);
|
||||
_node = _node.replaceAll(dynamicClassContent_2, v);
|
||||
}
|
||||
// 更新节点内容
|
||||
modifiedCode = modifiedCode.replace(node, _node);
|
||||
|
||||
@ -325,7 +325,7 @@ function transformPlugin(): Plugin {
|
||||
classNames.forEach((name, index) => {
|
||||
if (isTailwindClass(name)) {
|
||||
const safeName = toSafeClass(name);
|
||||
_node = _node.replace(name, safeName);
|
||||
_node = _node.replaceAll(name, safeName);
|
||||
classNames[index] = safeName;
|
||||
}
|
||||
});
|
||||
@ -346,7 +346,7 @@ function transformPlugin(): Plugin {
|
||||
// 生成暗黑模式类名的动态绑定
|
||||
const darkClassContent = darkClassNames
|
||||
.map((name) => {
|
||||
_node = _node.replace(name, "");
|
||||
_node = _node.replaceAll(name, "");
|
||||
return `'${name}': __isDark`;
|
||||
})
|
||||
.join(",");
|
||||
@ -365,7 +365,7 @@ function transformPlugin(): Plugin {
|
||||
(darkClassContent ? `${darkClassContent},` : "") +
|
||||
dynamicClassContent_1.substring(1);
|
||||
|
||||
_node = _node.replace(dynamicClassContent_1, v);
|
||||
_node = _node.replaceAll(dynamicClassContent_1, v);
|
||||
}
|
||||
|
||||
// 处理数组形式的动态类名
|
||||
@ -379,7 +379,7 @@ function transformPlugin(): Plugin {
|
||||
`{${darkClassContent}},` +
|
||||
dynamicClassContent_2.substring(1);
|
||||
|
||||
_node = _node.replace(dynamicClassContent_2, v);
|
||||
_node = _node.replaceAll(dynamicClassContent_2, v);
|
||||
}
|
||||
|
||||
// 更新节点内容
|
||||
|
||||
@ -526,41 +526,59 @@ export function interfaceToType(code: string) {
|
||||
export function test() {
|
||||
const html = `
|
||||
<template>
|
||||
<text :class="parseClass({'!bg-red-50': hoverable})"></text>
|
||||
<text :class="a ? 'text-red-100' : 'text-red-200'"></text>
|
||||
<text :class="\`text-red-300 \${true ? 'text-red-310' : 'text-red-320'}\`"></text>
|
||||
<text class="text-red-330"></text>
|
||||
<text :class="{
|
||||
1<text :class="parseClass({'!bg-red-50': hoverable})"></text>
|
||||
2<text :class="a ? 'text-red-100' : 'text-red-200'"></text>
|
||||
3<text :class="\`text-red-300 \${true ? 'text-red-310' : 'text-red-320'}\`"></text>
|
||||
4<text class="text-red-330"></text>
|
||||
5<text :class="{
|
||||
'text-red-400': a,
|
||||
'text-red-500': b,
|
||||
}"></text>
|
||||
<text :class="[
|
||||
6<text :class="[
|
||||
'text-red-600',
|
||||
'text-red-700',
|
||||
{
|
||||
'text-red-800': c,
|
||||
}
|
||||
]"></text>
|
||||
<text :class="\`text-red-900\` text-red-1000"></text>
|
||||
<text :pt="{
|
||||
7<text :class="\`text-red-900\` text-red-1000"></text>
|
||||
8<text :pt="{
|
||||
className: '!text-green-50'
|
||||
}"></text>
|
||||
<text :pt="{
|
||||
9<text :pt="{
|
||||
className: parseClass({
|
||||
'!text-green-100': hoverable,
|
||||
}),
|
||||
item: {
|
||||
className: 'text-green-200'
|
||||
className: '!text-green-200'
|
||||
},
|
||||
title: {
|
||||
className: '!text-green-300'
|
||||
}
|
||||
}"></text>
|
||||
<text :pt="{
|
||||
10<text :pt="{
|
||||
className: \`text-green-300 \${true ? 'text-red-310' : 'text-red-320'}\`
|
||||
}"></text>
|
||||
<text hover-class="text-green-400"></text>
|
||||
<text :hover-class="\`text-green-400\`"></text>
|
||||
<text :hover-class="parseClass({'!text-green-450': hoverable})"></text>
|
||||
<text :hover-class="a ? 'text-green-500' : 'text-green-600'"></text>
|
||||
<text :hover-class="\`text-green-700 \${true ? 'text-red-310' : 'text-red-320'}\`"></text>
|
||||
11<text hover-class="text-green-400"></text>
|
||||
12<text :hover-class="\`text-green-400\`"></text>
|
||||
13<text :hover-class="parseClass({'!text-green-450': hoverable})"></text>
|
||||
14<text :hover-class="a ? 'text-green-500' : 'text-green-600'"></text>
|
||||
15<text :hover-class="\`text-green-700 \${true ? 'text-red-310' : 'text-red-320'}\`"></text>
|
||||
16<cl-timeline-item
|
||||
icon="checkbox-circle-fill"
|
||||
:pt="{
|
||||
title: {
|
||||
className: '!text-primary-500'
|
||||
},
|
||||
icon: {
|
||||
className: '!text-primary-400'
|
||||
}
|
||||
}"
|
||||
title="更快速"
|
||||
date="2025-06-28 10:00:00"
|
||||
content="通过集成 cool-admin 的用户登录、版本管理、消息通知以及订单管理等基础模块。有效降低了开发成本,进而增强了市场竞争力。"
|
||||
>
|
||||
</cl-timeline-item>
|
||||
</template>
|
||||
`;
|
||||
|
||||
@ -584,4 +602,4 @@ export function test() {
|
||||
|
||||
// test();
|
||||
|
||||
// npx ./src/uniapp-x/utils.ts
|
||||
// npx tsx src/uniapp-x/utils.ts
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user