In our module snippet example in the Using the addPlugin helper section, we created a module that allows us to use the bootstrap-vue plugin globally in our app without having to use the import statement to require this plugin, as in the following example:
// pages/index.vue
<b-button size="sm" @click="toggle">
{{ show ? 'Hide' : 'Show' }} Alert
</b-button>
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
export default {
//...
}
It looks quite neat as we don't have to import bootstrap-vue every time, instead only having to import the CSS styles. However, we still can save a couple of lines by adding the styles to the global CSS stack of our app through the module. Let's create a new example and see how we can do that in the following steps:
- Create a module file with a const variable called options for passing the module and...