code refactor

This commit is contained in:
MaysWind
2025-01-11 02:29:44 +08:00
parent ea90e97f92
commit 5649bb243d
6 changed files with 10 additions and 10 deletions
@@ -19,7 +19,7 @@ export interface CommonIconProps {
size?: string | number;
}
export function useItemIcon(props: CommonIconProps) {
export function useItemIconBase(props: CommonIconProps) {
const style = computed<Record<IconItemStyleName, IconItemStyleValue>>(() => {
let defaultColor = 'var(--default-icon-color)';
+2 -2
View File
@@ -13,7 +13,7 @@
<script setup lang="ts">
import { computed } from 'vue';
import { type CommonIconProps, useItemIcon } from '@/components/base/ItemIcon.ts';
import { type CommonIconProps, useItemIconBase } from '@/components/base/ItemIconBase.ts';
import {
mdiEyeOffOutline
@@ -25,7 +25,7 @@ interface DesktopItemIconProps extends CommonIconProps {
}
const props = defineProps<DesktopItemIconProps>();
const { style, getAccountIcon, getCategoryIcon } = useItemIcon(props);
const { style, getAccountIcon, getCategoryIcon } = useItemIconBase(props);
const icons = {
hide: mdiEyeOffOutline
+2 -2
View File
@@ -6,10 +6,10 @@
<script setup lang="ts">
import { computed } from 'vue';
import { type CommonIconProps, useItemIcon } from '@/components/base/ItemIcon.ts';
import { type CommonIconProps, useItemIconBase } from '@/components/base/ItemIconBase.ts';
const props = defineProps<CommonIconProps>();
const { style, getAccountIcon, getCategoryIcon } = useItemIcon(props);
const { style, getAccountIcon, getCategoryIcon } = useItemIconBase(props);
const f7IconValue = computed<string>(() => {
if (props.iconType === 'fixed-f7') {