Skip to content

Commit a5e3f0b

Browse files
authored
Revert "docs(intro): Document alternative way to import plugins (bootstrap-vue#2617)" (bootstrap-vue#2621)
This reverts commit 4fe742b.
1 parent 6aa6e92 commit a5e3f0b

File tree

3 files changed

+8
-34
lines changed

3 files changed

+8
-34
lines changed

docs/components/importdoc.vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,9 @@ export default {
128128
},
129129
pluginImportCode() {
130130
const pluginLocation = this.isComponentRoute ? 'components' : 'directives'
131-
const pluginDotted = this.isComponentRoute ? 'componentPlugins' : 'directivePlugins'
132131
return [
133132
`import { ${this.pluginName} } from 'bootstrap-vue/es/${pluginLocation}'`,
134-
`Vue.use(${this.pluginName})`,
135-
'// Or',
136-
"import BoostrapVue from 'bootstrap-vue'",
137-
`Vue.use(BootstrapVue.${pluginDotted}.${this.pluginName})`
133+
`Vue.use(${this.pluginName})`
138134
].join('\n')
139135
}
140136
},

docs/markdown/intro/README.md

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ npm i vue bootstrap-vue bootstrap
1515
yarn add vue bootstrap-vue bootstrap
1616
```
1717

18-
Then, register BootstrapVue plugin in your app entry point (note that this installs **all**
19-
BootstrapVue components and directives):
18+
Then, register BootstrapVue plugin in your app entry point:
2019

2120
```js
2221
// app.js
@@ -67,8 +66,7 @@ yarn add bootstrap-vue
6766

6867
Add `bootstrap-vue/nuxt` to modules section of **nuxt.config.js**.
6968

70-
This will include both `boostrap.css` and `bootstrap-vue.css` default CSS, as well as all
71-
components and directives.
69+
This will include both `boostrap.css` and `bootstrap-vue.css` default CSS.
7270

7371
```js
7472
{
@@ -238,41 +236,23 @@ You can also import component groups and directives as Vue plugins by importing
238236
or directive directory:
239237

240238
```js
241-
// This imports all the layout components such as <b-container>, <b-row>, <b-col>
239+
// This imports all the layout components such as <b-container>, <b-row>, <b-col>:
242240
import { Layout } from 'bootstrap-vue/es/components'
243241
Vue.use(Layout)
244242

245-
// This imports <b-modal> as well as the v-b-modal directive as a plugin
243+
// This imports <b-modal> as well as the v-b-modal directive as a plugin:
246244
import { Modal } from 'bootstrap-vue/es/components'
247245
Vue.use(Modal)
248246

249-
// This imports <b-card> along with all the <b-card-*> sub-components as a plugin
247+
// This imports <b-card> along with all the <b-card-*> sub-components as a plugin:
250248
import { Card } from 'bootstrap-vue/es/components'
251249
Vue.use(Card)
252250

253-
// This imports directive v-b-scrollspy as a plugin
251+
// This imports directive v-b-scrollspy as a plugin:
254252
import { Scrollspy } from 'bootstrap-vue/es/directives'
255253
Vue.use(Scrollspy)
256254
```
257255

258-
Alternatively, you can import Plugins as follows:
259-
260-
```js
261-
import BootstrapVue from 'bootstrap-vue'
262-
263-
// This enables all the layout components such as <b-container>, <b-row>, <b-col>
264-
Vue.use(BootstrapVue.componentPlugins.Layout)
265-
266-
// This enables <b-modal> as well as the v-b-modal directive
267-
Vue.use(BootstrapVue.componentPlugins.Modal)
268-
269-
// This imports <b-card> along with all the <b-card-*> sub-components
270-
Vue.use(BootstrapVue.componentPlugins.Card)
271-
272-
// This enables directive v-b-scrollspy
273-
Vue.use(BootstrapVue.directivePlugins.Scrollspy)
274-
```
275-
276256
When importing as plugins, all subcomponents and related directives are imported in most cases. i.e.
277257
When importing `<b-nav>`, all the `<nav-*>` sub components are also included, as well all dropdown
278258
sub components. Component shorthand aliases (if any) are also included in the plugin.

src/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ const VuePlugin = {
1919
for (let plugin in directivePlugins) {
2020
Vue.use(directivePlugins[plugin])
2121
}
22-
},
23-
componentPlugins,
24-
directivePlugins
22+
}
2523
}
2624

2725
vueUse(VuePlugin)

0 commit comments

Comments
 (0)