S
S
Sergey Nikolaev2021-05-11 16:55:09
Bootstrap
Sergey Nikolaev, 2021-05-11 16:55:09

Where is the best place to include Bootstrap styles in a Vuejs project?

I create a project using Vue CLI
Install Bootstrap using npm
Now I include styles in the App.vue root component in the section<script>

import 'bootstrap/dist/css/bootstrap.min.css'

export default {...}


I came across information that you can also connect in the root file of the main.js project
import { createApp } from 'vue'
import App from './App.vue'
import 'bootstrap/dist/css/bootstrap.min.css'

createApp(App).mount('#app')


If there is no difference, why pay more, then where is it better to connect and why ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Nikolaev, 2021-11-08
@mccrush

There is practically no difference.
This is a question about the number of such connections. I generally make a separate module, call it cssImports.js and there I connect all third-party libraries in a comment column and import it into main.js

import '../imports/cssImports.js';
Thanks for the reply Alexander

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question