Home Web Front-end Bootstrap Tutorial How to introduce bootstrap in vue

How to introduce bootstrap in vue

Jul 29, 2019 pm 04:43 PM
bootstrap vue

How to introduce bootstrap in vue

If you want to know more about bootstrap, you can click: bootstrap tutorial

1. Introduction of jquery

Steps:

1. Install jquery

$ npm install jquery --save-dev
Copy after login

2. In webpack .config.js Add content

+ const webpack = require("webpack");
module.exports = {
    entry: './index.js',
    output: {
        path: path.join(__dirname, './dist'),
        publicPath: '/dist/',
        filename: 'index.js'
    },
  + plugins: [
        new webpack.ProvidePlugin({
            jQuery: 'jquery',
            $: 'jquery'
        })
    ]
}
Copy after login

3. Add content to the entry file index.js

import $ from 'jquery' ;
Copy after login

4. Test whether the installation is successful and see if '123' can pop up

<template>
  <div>
   Hello world!
  </div>
</template>
<script>
$(function () {  
    alert(123);  
 }); 
export default {
};
</script>
<style>
</style>
Copy after login

2. Introduce bootstrap

1. Install Bootstrap

$ npm install --save-dev bootstrap
Copy after login

2. Introduce it in the entry file index.js Related

import &#39;./node_modules/bootstrap/dist/css/bootstrap.min.css&#39;;
import &#39;./node_modules/bootstrap/dist/js/bootstrap.min.js&#39;;
Copy after login

3. Add a piece of Bootstrap code

 <div class="btn-group" role="group" aria-label="...">  
      <button type="button" class="btn btn-default">Left</button>  
      <button type="button" class="btn btn-default">Middle</button>  
      <button type="button" class="btn btn-default">Right</button>  
    </div>
Copy after login

4. View the effect

How to introduce bootstrap in vue

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

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to make the h5 drop-down menu How to make the h5 drop-down menu Apr 06, 2025 pm 12:24 PM

The Create H5 drop-down menu includes the following steps: Create a drop-down list, apply a CSS style, add toggle effects, and handle user selections. The specific steps are as follows: Use HTML to create a drop-down list. Use CSS to adjust the appearance of the drop-down menu. Use JavaScript or CSS to achieve the switching effect. Listen to change events to handle user selections.

What is the difference between H5 and JS? What is the difference between H5 and JS? Apr 06, 2025 am 09:30 AM

H5 is responsible for the structure and display of web content, just like a brush, while JS is responsible for the behavior and interaction of web pages, just like pigments, giving web pages dynamic capabilities. The two complement each other and jointly create a vibrant web page.

Which is more important, H5 or JS? Which is more important, H5 or JS? Apr 06, 2025 am 09:24 AM

H5 and JS are equally important, both are indispensable. H5 defines the web page structure, and JS gives web pages dynamic interaction capabilities. Mastering the two is the key to building an excellent web application, and you should not worry about which one is more important.

What is the relationship between JS and H5? What is the relationship between JS and H5? Apr 06, 2025 am 09:33 AM

The relationship between JS and H5: H5 is the stage (structure and content) of the web page, and JS is the actor on the stage (responsible for interaction and dynamic effects). They complement each other and are indispensable: H5 provides a stage and is responsible for building web structure, content and style. JS gives web pages the ability to interact dynamically, making web pages lively and interesting in response to user operations.

How to remove the default style in Bootstrap list? How to remove the default style in Bootstrap list? Apr 07, 2025 am 10:18 AM

The default style of the Bootstrap list can be removed with CSS override. Use more specific CSS rules and selectors, follow the "proximity principle" and "weight principle", overriding the Bootstrap default style. To avoid style conflicts, more targeted selectors can be used. If the override is unsuccessful, adjust the weight of the custom CSS. At the same time, pay attention to performance optimization, avoid overuse of !important, and write concise and efficient CSS code.

What is the reason why Bootstrap Table displays garbled code What is the reason why Bootstrap Table displays garbled code Apr 07, 2025 am 11:30 AM

The main reasons for displaying garbled code on Bootstrap Table are character set mismatch, encoding problems and poor browser compatibility. Solutions include: 1. Confirm character set consistency; 2. Check data transmission encoding; 3. Replace a browser with better compatibility; 4. Update the Bootstrap Table version; 5. Confirm the data format is correct; 6. Clear the browser cache.

What are the abbreviations of H5 and JS? What are the abbreviations of H5 and JS? Apr 06, 2025 am 09:21 AM

H5 is the abbreviation of HTML5, which extends the structure and semantics of web pages; JS is the abbreviation of JavaScript, which gives web pages interactive and dynamic functions. The combination of the two creates an amazing web experience and is the cornerstone of front-end development.

How to view Bootstrap's grid system How to view Bootstrap's grid system Apr 07, 2025 am 09:48 AM

Bootstrap's mesh system is a rule for quickly building responsive layouts, consisting of three main classes: container (container), row (row), and col (column). By default, 12-column grids are provided, and the width of each column can be adjusted through auxiliary classes such as col-md-, thereby achieving layout optimization for different screen sizes. By using offset classes and nested meshes, layout flexibility can be extended. When using a grid system, make sure that each element has the correct nesting structure and consider performance optimization to improve page loading speed. Only by in-depth understanding and practice can we master the Bootstrap grid system proficiently.

See all articles