-
-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vueuse directive not prefixed with "v" in .d.ts file #827
Comments
Can you try with unplugin-auto-import directives instead? https://github.com/unplugin/unplugin-auto-import/blob/main/playground/vite.config.ts#L21 |
@userquin Is it also an option for webpack? Not using Vite at the moment. |
it should, just move the configuration from vue components to auto import plugin (Volar should also suggest directives) |
@userquin Would there be a simple way to do this for VueUse's directives instead of custom directory? |
vueuse should export a directives preset for unimport/auto-import (vueuse/vueuse#4225) , but you can create a preset in the meantime: import type { InlinePreset } from 'unimport'
...
AutoImport({
vueDirectives: true,
imports: [
'vue',
'@vueuse/core',
// maybe you need to move this inline preset before previous preset adding the type and the import
<InlinePreset>{
from: '@vueuse/components' // <== the directive exported from components
meta: { vueDirective: true },
imports: [{ name: 'vOnLongPress' }, ....] // <== maybe can be used with the name directly (no laptop)
// imports: ['vOnLongPress',...] <== with this
}
]
}) EDIT: |
Describe the bug
The outputed name of the directive is not prefixed with "v" making TS unhappy:
Reproduction
not needed
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: