diff --git a/src/components/Iconify/index.vue b/src/components/Iconify/index.vue index b5e8706..084c017 100644 --- a/src/components/Iconify/index.vue +++ b/src/components/Iconify/index.vue @@ -14,21 +14,29 @@ interface Props { } const props = withDefaults(defineProps(), { size: 'inherit', - color: 'inherit', }); const iconSize = computed(() => (Number.isNaN(Number(props.size)) ? `${props.size}` : `${props.size}rpx`)); + +const iconStyle = computed(() => { + const styles: Record = {}; + if (props.color) { + styles.color = props.color; + } + if (props.size) { + styles.fontSize = iconSize.value; + } + return styles; +}); diff --git a/src/pages/demo/index.vue b/src/pages/demo/index.vue index 7d0037f..780d07f 100644 --- a/src/pages/demo/index.vue +++ b/src/pages/demo/index.vue @@ -13,7 +13,7 @@ const demo = ref('Demo'); - +