首页 / VUE / vue如何引入bootstrap
vue如何引入bootstrap
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了vue如何引入bootstrap,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1177字,纯文字阅读大概需要2分钟。
内容图文
![vue如何引入bootstrap](/upload/InfoBanner/zyjiaocheng/283/ce586bed5d3e49bbb8836621f1603fa4.jpg)
![vue如何引入bootstrap - 文章图片](/upload/getfiles/0001/2021/4/22/20210422042538612.jpg)
如果你想了解更多关于bootstrap的知识,可以点击:bootstrap教程
一、引入jquery
步骤:
1. 安装jquery
$ npm install jquery --save-dev
2.在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.在入口文件index.js 里面添加内容
import $ from 'jquery' ;
4.测试一下是否安装成功,看看能否弹出'123'
<template> <div> Hello world! </div> </template> <script> $(function () { alert(123); }); export default { }; </script> <style> </style>
二、引入bootstrap
1、安装Bootstrap
$ npm install --save-dev bootstrap
2、在入口文件index.js里引入相关
import './node_modules/bootstrap/dist/css/bootstrap.min.css'; import './node_modules/bootstrap/dist/js/bootstrap.min.js';
3、添加一段Bootstrap代码
<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>
4、查看效果
以上就是vue如何引入bootstrap的详细内容,更多请关注Gxl网其它相关文章!
内容总结
以上是互联网集市为您收集整理的vue如何引入bootstrap全部内容,希望文章能够帮你解决vue如何引入bootstrap所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。