<template>
    <i class="iconfont" :class="name" :style="iconStyle"></i>
</template>

<script setup lang="ts">
import { computed } from 'vue'

const props = defineProps({
    name: {
        type: String,
        default: ''
    },
    size: {
        type: Number,
        default: 16
    },
    color: {
        type: String,
        default: '#000'
    }
})
const iconStyle = computed(() => {
    let style = {}
    const { size, color } = props
    style = {
        fontSize: uni.$u.addUnit(size),
        color
    }
    return style
})
</script>
<style scoped></style>
