10000 chore(plugin): add NAME option to `vueUse` (closes #3849) by tmorehouse · Pull Request #3850 · bootstrap-vue/bootstrap-vue · GitHub
[go: up one dir, main page]

Skip to content

chore(plugin): add NAME option to vueUse (closes #3849) #3850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { componentsPlugin } from './components/index.esm'
import { directivesPlugin } from './directives/index.esm'
import BVConfigPlugin from './bv-config'

const NAME = 'BootstrapVue'

// Named exports of all components and component group plugins
export * from './components/index.esm'

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

// BootstrapVue plugin
const BootstrapVue = /*#__PURE__*/ {
install: install,
install,
NAME,
// To be deprecated. not documented
setConfig: setConfig
setConfig
}

// Named exports for BvConfigPlugin and BootstrapVue
Expand All @@ -36,6 +39,7 @@ export {
// BootstrapVue = require('bootstrap-vue').default
// Vue.use(BootstrapVue)
install,
NAME,
// To be deprecated. not documented
setConfig
}
Expand Down
4 changes: 4 additions & 0 deletions src/utils/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,8 @@ export const vueUse = VuePlugin => {
if (hasWindowSupport && window.Vue) {
window.Vue.use(VuePlugin)
}
/* istanbul ignore next */
if (hasWindowSupport && VuePlugin.NAME) {
window[VuePlugin.NAME] = VuePlugin
}
}
0