解决打包后 cl-icon 颜色异常问题

This commit is contained in:
icssoa
2025-10-22 17:49:07 +08:00
parent 0d76580fbb
commit 2917c2251b

View File

@@ -6,7 +6,17 @@
<script setup lang="ts"> <script setup lang="ts">
import { computed, type PropType } from "vue"; import { computed, type PropType } from "vue";
import { forInObject, get, has, parsePt, useCache, isDark, ctx, hasTextColor } from "@/cool"; import {
forInObject,
get,
has,
parsePt,
useCache,
isDark,
ctx,
hasTextColor,
isNull
} from "@/cool";
import { icons } from "@/icons"; import { icons } from "@/icons";
import { useSize } from "../../hooks"; import { useSize } from "../../hooks";
@@ -97,7 +107,7 @@ const icon = computed<Icon>(() => {
// 图标颜色 // 图标颜色
const color = computed(() => { const color = computed(() => {
if (props.color != "") { if (props.color != "" && !isNull(props.color)) {
switch (props.color) { switch (props.color) {
case "primary": case "primary":
return ctx.color["primary-500"] as string; return ctx.color["primary-500"] as string;