File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ import type { ComponentResolver } from '../../types'
2
+
3
+ export interface BootstrapVue3ResolverOptions {
4
+ /**
5
+ * Auto import for directives.
6
+ *
7
+ * @default true
8
+ */
9
+ directives ?: boolean
10
+ }
11
+
12
+ /**
13
+ * Resolver for BootstrapVue
14
+ *
15
+ * @link https://github.com/cdmoro/bootstrap-vue-3
16
+ */
17
+ export const BootstrapVue3Resolver = ( _options : BootstrapVue3ResolverOptions = { } ) : Array < ComponentResolver > => {
18
+ const options = { directives : true , ..._options }
19
+ const resolvers : Array < ComponentResolver > = [ {
20
+ type : 'component' ,
21
+ resolve : ( name ) => {
22
+ if ( name . match ( / ^ B [ A - Z ] / ) )
23
+ return { name, from : 'bootstrap-vue-3' }
24
+ } ,
25
+ } ]
26
+
27
+ if ( options . directives ) {
28
+ resolvers . push ( {
29
+ type : 'directive' ,
30
+ resolve : ( name ) => {
31
+ if ( name . match ( / ^ B [ A - Z ] / ) )
32
+ return { name : `V${ name } ` , from : 'bootstrap-vue-3' }
33
+ } ,
34
+ } )
35
+ }
36
+
37
+ return resolvers
38
+ }
Original file line number Diff line number Diff line change @@ -19,4 +19,5 @@ export * from './arco'
19
19
export * from './tdesign'
20
20
export * from './layui-vue'
21
21
export * from './bootstrap-vue'
22
+ export * from './bootstrap-vue-3'
22
23
export * from './ionic'
You can’t perform that action at this time.
0 commit comments