Plugin doesn't import all sub-components
See original GitHub issueDescribe the bug
According to the documentation on plugins, importing a plugin should import all sub-components as well.
When importing as plugins, all subcomponents and related directives are imported in most cases. i.e. When importing <b-nav>, all the <nav-*> sub components are also included, as well all dropdown sub components.
I’ve added the following import:
import { FormPlugin } from 'bootstrap-vue'
Vue.use(FormPlugin)
However, when using form components like b-form-input
or b-form-checkbox
, I get error messages:
Unknown custom element: <b-form-input> - did you register the component correctly? For recursive components, make sure to provide the “name” option.
Did I misinterpret the documentation? Or does it simply not apply to b-form
and I have to import every single form component I want to use individually?
Steps to reproduce the bug
- Use the above mentioned import
- Add a
<b-form-input>
to the page - Check error console
Expected behavior
The form sub-components should be imported automatically.
Versions
Libraries:
- BootstrapVue: 2.15.0
- Bootstrap: 4.5.0
- Vue: 2.6.11
Environment:
- Device: Laptop
- OS: Windows 10
- Browser: Chrome
- Version: 83.0.4103.116
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Someone made this loader https://www.npmjs.com/package/bootstrap-vue-loader, which goal was to automatically import only the components used, removing the need to manually importing them.
I haven’t tested it, and i don’t know how well it works. But you can try it if you want.
Ok, thanks again. I was just wondering if there’s a less granular way of importing components.