mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-12 05:32:48 +00:00
1
This commit is contained in:
parent
11c710c1c3
commit
11ce54a70a
10
packages/vite-plugin/dist/index.js
vendored
10
packages/vite-plugin/dist/index.js
vendored
@ -688,7 +688,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// test();
|
// test();
|
||||||
// npx ./src/uniapp-x/utils.ts
|
// npx tsx src/uniapp-x/utils.ts
|
||||||
|
|
||||||
// 全局 service 对象,用于存储服务结构
|
// 全局 service 对象,用于存储服务结构
|
||||||
const service = {};
|
const service = {};
|
||||||
@ -2056,7 +2056,7 @@ if (typeof window !== 'undefined') {
|
|||||||
classNames.forEach((name, index) => {
|
classNames.forEach((name, index) => {
|
||||||
if (isTailwindClass(name)) {
|
if (isTailwindClass(name)) {
|
||||||
const safeName = toSafeClass(name);
|
const safeName = toSafeClass(name);
|
||||||
_node = _node.replace(name, safeName);
|
_node = _node.replaceAll(name, safeName);
|
||||||
classNames[index] = safeName;
|
classNames[index] = safeName;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -2071,7 +2071,7 @@ if (typeof window !== 'undefined') {
|
|||||||
// 生成暗黑模式类名的动态绑定
|
// 生成暗黑模式类名的动态绑定
|
||||||
const darkClassContent = darkClassNames
|
const darkClassContent = darkClassNames
|
||||||
.map((name) => {
|
.map((name) => {
|
||||||
_node = _node.replace(name, "");
|
_node = _node.replaceAll(name, "");
|
||||||
return `'${name}': __isDark`;
|
return `'${name}': __isDark`;
|
||||||
})
|
})
|
||||||
.join(",");
|
.join(",");
|
||||||
@ -2083,7 +2083,7 @@ if (typeof window !== 'undefined') {
|
|||||||
const v = dynamicClassContent_1[0] +
|
const v = dynamicClassContent_1[0] +
|
||||||
(darkClassContent ? `${darkClassContent},` : "") +
|
(darkClassContent ? `${darkClassContent},` : "") +
|
||||||
dynamicClassContent_1.substring(1);
|
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("]"));
|
const dynamicClassContent_2 = classContents.find((content) => content.startsWith("[") && content.endsWith("]"));
|
||||||
@ -2091,7 +2091,7 @@ if (typeof window !== 'undefined') {
|
|||||||
const v = dynamicClassContent_2[0] +
|
const v = dynamicClassContent_2[0] +
|
||||||
`{${darkClassContent}},` +
|
`{${darkClassContent}},` +
|
||||||
dynamicClassContent_2.substring(1);
|
dynamicClassContent_2.substring(1);
|
||||||
_node = _node.replace(dynamicClassContent_2, v);
|
_node = _node.replaceAll(dynamicClassContent_2, v);
|
||||||
}
|
}
|
||||||
// 更新节点内容
|
// 更新节点内容
|
||||||
modifiedCode = modifiedCode.replace(node, _node);
|
modifiedCode = modifiedCode.replace(node, _node);
|
||||||
|
|||||||
@ -325,7 +325,7 @@ function transformPlugin(): Plugin {
|
|||||||
classNames.forEach((name, index) => {
|
classNames.forEach((name, index) => {
|
||||||
if (isTailwindClass(name)) {
|
if (isTailwindClass(name)) {
|
||||||
const safeName = toSafeClass(name);
|
const safeName = toSafeClass(name);
|
||||||
_node = _node.replace(name, safeName);
|
_node = _node.replaceAll(name, safeName);
|
||||||
classNames[index] = safeName;
|
classNames[index] = safeName;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -346,7 +346,7 @@ function transformPlugin(): Plugin {
|
|||||||
// 生成暗黑模式类名的动态绑定
|
// 生成暗黑模式类名的动态绑定
|
||||||
const darkClassContent = darkClassNames
|
const darkClassContent = darkClassNames
|
||||||
.map((name) => {
|
.map((name) => {
|
||||||
_node = _node.replace(name, "");
|
_node = _node.replaceAll(name, "");
|
||||||
return `'${name}': __isDark`;
|
return `'${name}': __isDark`;
|
||||||
})
|
})
|
||||||
.join(",");
|
.join(",");
|
||||||
@ -365,7 +365,7 @@ function transformPlugin(): Plugin {
|
|||||||
(darkClassContent ? `${darkClassContent},` : "") +
|
(darkClassContent ? `${darkClassContent},` : "") +
|
||||||
dynamicClassContent_1.substring(1);
|
dynamicClassContent_1.substring(1);
|
||||||
|
|
||||||
_node = _node.replace(dynamicClassContent_1, v);
|
_node = _node.replaceAll(dynamicClassContent_1, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理数组形式的动态类名
|
// 处理数组形式的动态类名
|
||||||
@ -379,7 +379,7 @@ function transformPlugin(): Plugin {
|
|||||||
`{${darkClassContent}},` +
|
`{${darkClassContent}},` +
|
||||||
dynamicClassContent_2.substring(1);
|
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() {
|
export function test() {
|
||||||
const html = `
|
const html = `
|
||||||
<template>
|
<template>
|
||||||
<text :class="parseClass({'!bg-red-50': hoverable})"></text>
|
1<text :class="parseClass({'!bg-red-50': hoverable})"></text>
|
||||||
<text :class="a ? 'text-red-100' : 'text-red-200'"></text>
|
2<text :class="a ? 'text-red-100' : 'text-red-200'"></text>
|
||||||
<text :class="\`text-red-300 \${true ? 'text-red-310' : 'text-red-320'}\`"></text>
|
3<text :class="\`text-red-300 \${true ? 'text-red-310' : 'text-red-320'}\`"></text>
|
||||||
<text class="text-red-330"></text>
|
4<text class="text-red-330"></text>
|
||||||
<text :class="{
|
5<text :class="{
|
||||||
'text-red-400': a,
|
'text-red-400': a,
|
||||||
'text-red-500': b,
|
'text-red-500': b,
|
||||||
}"></text>
|
}"></text>
|
||||||
<text :class="[
|
6<text :class="[
|
||||||
'text-red-600',
|
'text-red-600',
|
||||||
'text-red-700',
|
'text-red-700',
|
||||||
{
|
{
|
||||||
'text-red-800': c,
|
'text-red-800': c,
|
||||||
}
|
}
|
||||||
]"></text>
|
]"></text>
|
||||||
<text :class="\`text-red-900\` text-red-1000"></text>
|
7<text :class="\`text-red-900\` text-red-1000"></text>
|
||||||
<text :pt="{
|
8<text :pt="{
|
||||||
className: '!text-green-50'
|
className: '!text-green-50'
|
||||||
}"></text>
|
}"></text>
|
||||||
<text :pt="{
|
9<text :pt="{
|
||||||
className: parseClass({
|
className: parseClass({
|
||||||
'!text-green-100': hoverable,
|
'!text-green-100': hoverable,
|
||||||
}),
|
}),
|
||||||
item: {
|
item: {
|
||||||
className: 'text-green-200'
|
className: '!text-green-200'
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
className: '!text-green-300'
|
||||||
}
|
}
|
||||||
}"></text>
|
}"></text>
|
||||||
<text :pt="{
|
10<text :pt="{
|
||||||
className: \`text-green-300 \${true ? 'text-red-310' : 'text-red-320'}\`
|
className: \`text-green-300 \${true ? 'text-red-310' : 'text-red-320'}\`
|
||||||
}"></text>
|
}"></text>
|
||||||
<text hover-class="text-green-400"></text>
|
11<text hover-class="text-green-400"></text>
|
||||||
<text :hover-class="\`text-green-400\`"></text>
|
12<text :hover-class="\`text-green-400\`"></text>
|
||||||
<text :hover-class="parseClass({'!text-green-450': hoverable})"></text>
|
13<text :hover-class="parseClass({'!text-green-450': hoverable})"></text>
|
||||||
<text :hover-class="a ? 'text-green-500' : 'text-green-600'"></text>
|
14<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>
|
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>
|
</template>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@ -584,4 +602,4 @@ export function test() {
|
|||||||
|
|
||||||
// test();
|
// test();
|
||||||
|
|
||||||
// npx ./src/uniapp-x/utils.ts
|
// npx tsx src/uniapp-x/utils.ts
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user