I want to incorporate lucidev icons into my component, but I am fairly new to typescript.
You can find the lucidev icons here: https://github.com/lucide-icons/lucide
<template>
<component :is="icon" />
</template>
<script lang="ts">
import * as icons from 'lucide-vue-next';
import { defineComponent } from 'vue';
export default defineComponent({
props: {
name: {
type: String,
required: true,
},
size
},
computed: {
icon() {
return icons[this.name];
},
},
});
</script>
However, I am encountering an issue where I receive an error message stating that "element implicitly has an 'any' type because expression of type 'string' can't be used to index type in icons[this.name]". How can I resolve this problem?
icons: