unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue
https://www.npmjs.com/package/unplugin-vue-components
MIT License
3.65k stars 341 forks source link

[QUESTION] Auto-import custom directives #741

Open go4cas opened 4 months ago

go4cas commented 4 months ago

Is there a guideline on how to auto-import custom directives (Vue 3, using Vite)?

In the config, I have set directives: true and even added dirs: ['./src/components', './src/directives'],, but somehow I still get "Failed to resolve directive: format " warnings.

Anything else I missed in the config? How should the directive be structured in the file?