<template>
<i class="c-icon" :class="{[`c-icon--${type}`]:type}">
<font-awesome-icon v-bind="fontawesomeProps" />
</i>
</template>
<script setup lang="ts">
import type { IconProps } from './types'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
defineOptions({
name: 'CIcon',
inheritAttrs: false
})
const props = defineProps<IconProps>()
const omit = (object, paths) => {
const result = {};
for (const key in object) {
if (!paths.includes(key)) {
result[key] = object[key];
}
}
return result;
}
const fontawesomeProps = omit(props, ['type', 'color']);
老师我请教一下如果自己写这个omit函数,应该怎么给这个函数标注ts类型