You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to automatically import components like FormilyInput, FormilyFormItem, and FormilySelect along with their styles. Currently, the resolvers configuration of unplugin-auto-import cannot achieve this because vueTemplateAddon does not support matchImports.
In the transform hook, I only transform placeholders for Vue context properties that can match imports. Then, in the matchImports hook, I handle these placeholders and re-execute the matchImports hooks of other plugins to collect side effects.
Additional information
Would you be willing to help implement this feature?
The text was updated successfully, but these errors were encountered:
Background
When I use formily as a form library, rendering form controls involves the following approach:
I want to automatically import components like
FormilyInput
,FormilyFormItem
, andFormilySelect
along with their styles. Currently, theresolvers
configuration ofunplugin-auto-import
cannot achieve this becausevueTemplateAddon
does not supportmatchImports
.My Solution
To solve this issue, I came up with a solution, and the code can be found at https://github.com/Sun79/unimport/tree/feat/match-imports-in-vue-template.
I am not sure if this is the optimal solution, but it works well in my project.
Approach
In the
transform
hook, I only transform placeholders for Vue context properties that can match imports. Then, in thematchImports
hook, I handle these placeholders and re-execute thematchImports
hooks of other plugins to collect side effects.Additional information
The text was updated successfully, but these errors were encountered: