Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use bootstrap in vue

Shulou Source: shulou.com Published: 2022-06-03 10:38:34 11月15日 Update

This article is about how to use bootstrap in vue. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

I. introduction of jquery

Steps:

1. Install jquery

$npm install jquery-save-dev

2. Add content to webpack.config.js

+ 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'})]}

3. Add content to the entry file index.js

Import $from 'jquery'

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

Hello world! $(function () {alert (123);}); export default {}

Second, introduce Bootstrap

1. Install Bootstrap

$npm install-save-dev bootstrap

2. Introduce relevant information into the entry file index.js

Import'. / node_modules/bootstrap/dist/css/bootstrap.min.css';import'. / node_modules/bootstrap/dist/js/bootstrap.min.js'

3. Add a piece of Bootstrap code

Left Middle Right

4. Run to see the effect these buttons have become Bootstrap button groups

Thank you for reading! This is the end of this article on "how to use bootstrap in vue". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Content entries buttons files more articles good practical successful code effects articles steps look knowledge plus one reference help related testing Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Docker Shulou Information vpn Linux