|
1 | 1 | import * as componentPlugins from './components'
|
2 | 2 | import * as directivePlugins from './directives'
|
3 |
| -// import { vueUse } from './utils/plugins' |
| 3 | +import { vueUse } from './utils/plugins' |
4 | 4 | // import { setConfig } from './utils/config'
|
5 | 5 |
|
6 |
| -const BootstrapVue = (Vue, config = {}) => { |
7 |
| - // Configure BootstrapVue |
8 |
| - // setConfig(config) |
| 6 | +const BootstrapVue = { |
| 7 | + install(Vue, config = {}) { |
| 8 | + // Configure BootstrapVue |
| 9 | + // setConfig(config) |
9 | 10 |
|
10 |
| - // Register component plugins |
11 |
| - for (let plugin in componentPlugins) { |
12 |
| - Vue.use(componentPlugins[plugin]) |
13 |
| - } |
| 11 | + // Register component plugins |
| 12 | + for (let plugin in componentPlugins) { |
| 13 | + Vue.use(componentPlugins[plugin]) |
| 14 | + } |
14 | 15 |
|
15 |
| - // Register directive plugins |
16 |
| - for (let plugin in directivePlugins) { |
17 |
| - Vue.use(directivePlugins[plugin]) |
| 16 | + // Register directive plugins |
| 17 | + for (let plugin in directivePlugins) { |
| 18 | + Vue.use(directivePlugins[plugin]) |
| 19 | + } |
18 | 20 | }
|
19 | 21 | }
|
20 | 22 |
|
21 |
| -// expose the config method |
22 |
| -// BootstrapVue.setConfig = setConfig |
23 |
| - |
24 | 23 | // Auto installation only occurs if window.Vue exists
|
25 |
| -if (window && window.Vue && window.Vue.use) { |
26 |
| - /* istanbul ignore next */ |
27 |
| - window.BootstrapVue = BootstrapVue |
28 |
| - /* istanbul ignore next */ |
29 |
| - window.Vue.use(BootstrapVue) |
30 |
| -} |
| 24 | +vueUse(BootstrapVue) |
31 | 25 |
|
32 | 26 | export default BootstrapVue
|
0 commit comments