Skip to content

Commit 8e956e3

Browse files
authored
chore(plugin): add NAME option to vueUse (closes bootstrap-vue#3849) (bootstrap-vue#3850)
1 parent 3c2ea39 commit 8e956e3

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { componentsPlugin } from './components/index.esm'
44
import { directivesPlugin } from './directives/index.esm'
55
import BVConfigPlugin from './bv-config'
66

7+
const NAME = 'BootstrapVue'
8+
79
// Named exports of all components and component group plugins
810
export * from './components/index.esm'
911

@@ -15,9 +17,10 @@ const install = /*#__PURE__*/ installFactory({ plugins: { componentsPlugin, dire
1517

1618
// BootstrapVue plugin
1719
const BootstrapVue = /*#__PURE__*/ {
18-
install: install,
20+
install,
21+
NAME,
1922
// To be deprecated. not documented
20-
setConfig: setConfig
23+
setConfig
2124
}
2225

2326
// Named exports for BvConfigPlugin and BootstrapVue
@@ -36,6 +39,7 @@ export {
3639
// BootstrapVue = require('bootstrap-vue').default
3740
// Vue.use(BootstrapVue)
3841
install,
42+
NAME,
3943
// To be deprecated. not documented
4044
setConfig
4145
}

src/utils/plugins.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,8 @@ export const vueUse = VuePlugin => {
129129
if (hasWindowSupport && window.Vue) {
130130
window.Vue.use(VuePlugin)
131131
}
132+
/* istanbul ignore next */
133+
if (hasWindowSupport && VuePlugin.NAME) {
134+
window[VuePlugin.NAME] = VuePlugin
135+
}
132136
}

0 commit comments

Comments
 (0)