Home > Web Front-end > Vue.js > How to introduce bootstrap into vue.js

How to introduce bootstrap into vue.js

coldplay.xixi
Release: 2023-01-13 00:44:45
Original
4185 people have browsed it

How to introduce bootstrap into vue.js: First use the [npm install bootstrap --save-dev] command to install it; then use the [import 'bootstrap related file path'] syntax in [main.js] to introduce it That’s it.

How to introduce bootstrap into vue.js

The operating environment of this tutorial: windows7 system, Vue2.9.6&&bootstrap3 version, Dell G3 computer.

【Recommended related articles: vue.js

How to introduce bootstrap in vue.js:

1. Use the command:

npm install bootstrap --save-dev
Copy after login

2. After successful installation, you can see the bootstrap module in the package.json folder. At this time, you need to add the following content to main.js:

import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap/dist/js/bootstrap.min'
Copy after login

At this point, the introduction of bootstrap is completed. Next, our focus comes, because BootStrap and VUE have a special design called bootstrap-vue.js, so After we introduce it, we can directly use the proprietary styles they provide, which is much better than the native bootstrap.

3. Use the command:

npm i vue bootstrap-vue bootstrap
Copy after login

4. Add: to the main.js file:

import Vue from 'vue'
import BootstrapVue from 'bootstrap-vue'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
Vue.use(BootstrapVue)
Copy after login

Related free learning recommendations: javascript (video)

The above is the detailed content of How to introduce bootstrap into vue.js. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template