refactor: use @ant-design/fast-color instead (#4070)

* refactor: Use @ant-design/fast-color instead

* fix: test failed

* chore: remove isValidColor

All FastColor objects are valid. So isValid is always true.
FastColor("not-a-color") -> `#000000`

* refactor: rename directory `colorful` to `color`

* fix: ci fail
This commit is contained in:
Li Kui
2024-08-07 21:28:25 +08:00
committed by GitHub
parent 861f39b519
commit 1d38fb647e
13 changed files with 871 additions and 1080 deletions

View File

@@ -3,7 +3,7 @@ import type { MenuRecordBadgeRaw } from '@vben-core/typings';
import { computed } from 'vue';
import { isValidColor } from '@vben-core/shared';
import { convertToRgb } from '@vben-core/shared';
import BadgeDot from './menu-badge-dot.vue';
@@ -34,9 +34,9 @@ const badgeClass = computed(() => {
});
const badgeStyle = computed(() => {
if (badgeClass.value && isValidColor(badgeClass.value)) {
if (badgeClass.value) {
return {
backgroundColor: badgeClass.value,
backgroundColor: convertToRgb(badgeClass.value),
};
}
return {};