FortAwesome / vue-fontawesome

Font Awesome Vue component
https://fontawesome.com
MIT License
2.38k stars 134 forks source link

feat: add FontAwesomeIconProps export in index.d.ts #496

Closed lctech-jeff closed 1 month ago

lctech-jeff commented 3 months ago

This will fix the export issue like mentioned before.

FaIcon.vue

<template>
  <FontAwesomeIcon :icon="props.icon" />
</template>

<script setup lang="ts">
import { type FontAwesomeIconProps, FontAwesomeIcon } from '@fortawesome/vue-fontawesome'

// will get error with @vue/compiler-sfc
const props = defineProps<InstanceType<typeof FontAwesomeIcon>['$props']>()

// missing FontAwesomeIconProps in export
// const props = defineProps<FontAwesomeIconProps>()
</script>

<style lang="scss" scoped></style>

if I use InstanceType<typeof FontAwesomeIcon>['$props'], then error occur like this picture.

截圖 2024-04-02 下午2 14 15







We except to use the code like this const props = defineProps<FontAwesomeIconProps>().

lctech-LeoLioa commented 3 months ago

Also interested in this

jasonlundien commented 1 month ago

I do not believe this is needed any longer with the Release of 3.0.8.

These props are now being exported:

export { FontAwesomeIcon, FontAwesomeIconProps, FontAwesomeLayers, FontAwesomeLayersProps, FontAwesomeLayersText, FontAwesomeLayersTextProps }

If you feel otherwise, just let me know.

Thank you, -jason