Skip to content

Commit b14fd5a

Browse files
authored
Update index.js
1 parent 1a03540 commit b14fd5a

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

src/index.js

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,26 @@
11
import * as componentPlugins from './components'
22
import * as directivePlugins from './directives'
3-
// import { vueUse } from './utils/plugins'
3+
import { vueUse } from './utils/plugins'
44
// import { setConfig } from './utils/config'
55

6-
const BootstrapVue = (Vue, config = {}) => {
7-
// Configure BootstrapVue
8-
// setConfig(config)
6+
const BootstrapVue = {
7+
install(Vue, config = {}) {
8+
// Configure BootstrapVue
9+
// setConfig(config)
910

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+
}
1415

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+
}
1820
}
1921
}
2022

21-
// expose the config method
22-
// BootstrapVue.setConfig = setConfig
23-
2423
// 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)
3125

3226
export default BootstrapVue

0 commit comments

Comments
 (0)