Implementing Custom Component Naming and Efficient Imports in Vue 3 with TypeScript #9198
Unanswered
vildanbina
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys,
I have segregated my components into separate folders, and due to their large number, I have decided to create an
index.ts
file within each folder to define aliases for the components, like so:However, the issue I am facing is that the alias
CustomTestComponent
is not being handled when I want to invoke it, and I need to add it manually every time. I have seen solutions suggesting the creation of other items at the root level, such as acomponents.d.ts
file where the components are defined, but this does not seem like the right solution to me because I would have to define all the components in more than one place.I am looking for a solution where I can centrally manage and invoke the aliases without defining them at multiple places. I am inclined to maintain best practices and write clean and manageable code. Do you have any suggestions on how I could achieve this?
Thank you for your assistance.
Beta Was this translation helpful? Give feedback.
All reactions