File tree Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @vue-hooks-plus/resolvers" ,
3
- "version" : " 1.0 .0" ,
3
+ "version" : " 1.1 .0" ,
4
4
"description" : " " ,
5
5
"type" : " module" ,
6
6
"main" : " dist/index.cjs" ,
Original file line number Diff line number Diff line change 1
- export * from './vite '
1
+ export * from './unplugin-auto-import '
Original file line number Diff line number Diff line change @@ -4,7 +4,14 @@ import { readFileSync } from 'node:fs'
4
4
5
5
let hooks : string [ ] | undefined
6
6
7
- export type VueHooksPlusResolverOptions = Record < string , any >
7
+ export type VueHooksPlusResolverOptions = {
8
+ /**
9
+ * prefix for name of components
10
+ *
11
+ * @default ''
12
+ */
13
+ prefix ?: string
14
+ }
8
15
9
16
function queryMetaData ( ) {
10
17
try {
@@ -23,16 +30,16 @@ function queryMetaData() {
23
30
}
24
31
}
25
32
26
- function resolveHooks ( name : string , _options : VueHooksPlusResolverOptions ) {
33
+ function resolveHooks ( name : string , options : VueHooksPlusResolverOptions ) {
27
34
if ( ! hooks ) return
28
35
36
+ const { prefix } = options
37
+ if ( prefix ) {
38
+ if ( ! name . startsWith ( prefix ) ) return
39
+ name = name . substring ( prefix . length )
40
+ }
29
41
if ( ! hooks . includes ( name ) ) return
30
42
31
- console . log ( {
32
- name,
33
- from : 'vue-hooks-plus' ,
34
- } )
35
-
36
43
return {
37
44
name,
38
45
from : 'vue-hooks-plus' ,
You can’t perform that action at this time.
0 commit comments