<template>
  <i :class="[name]" :style="[fontStyle]" class="icon"></i>
</template>

<script setup>
import {computed} from "vue";

const emits = defineEmits(['click'])

const props = defineProps({
  name: String,
  // 字体大小
  size: {
    type: [Number, String],
    default: ''
  },
  color: {
    type: String,
    default: ''
  }
})
const onClick = () => {
  emits('click')
}

const fontStyle = computed(() => {
  const style = {}
  if (props.size) style.fontSize = props.size + uni.$uv.config.unit
  if (props.color) style.color = props.color
  return style
})

</script>

<style scoped>

</style>
