electron中使用bootstrap

安裝

安裝bootstrap命令如下:
npm install bootstrap --save
 

成都創(chuàng)新互聯(lián)公司主營(yíng)東勝網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營(yíng)網(wǎng)站建設(shè)方案,成都App制作,東勝h5小程序設(shè)計(jì)搭建,東勝網(wǎng)站營(yíng)銷(xiāo)推廣歡迎東勝等地區(qū)企業(yè)咨詢(xún)

安裝后可能報(bào)告如下錯(cuò)誤:
npm WARN bootstrap@4.1.3 requires a peer of popper.js@^1.14.3 but none is installed. You must install peer dependencies yourself.
 

需要自行安裝popper,命令如下:
npm install popper.js@^1.14.3 --save
 

頁(yè)面引入bootstrap

頁(yè)面引入bootstrap的css和js文件如下:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="./node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
</head>
<body>
Hello electron!
<div>
    <button id="openFile" class="btn btn-success">Open File</button>
    <button id="sendMsg" class="btn btn-warning">Send Message (Open File)</button>
</div>
<script>
    window.$ = window.jQuery = require('./node_modules/jquery/dist/jquery.min.js');
    require('./node_modules/bootstrap/dist/js/bootstrap.min.js');
</script>

注:網(wǎng)上有的例子中,引入bootstrap.min.css是用傳統(tǒng)方式引入,即:

<link rel="stylesheet" >

這種方式太搞笑了吧,明明已經(jīng)在本地裝好了全套的bootstrap,偏偏CSS還要用網(wǎng)絡(luò)方式引入,又浪費(fèi)流量,速度又慢,真是不知道想出這種方式的人是怎么想的。

本文題目:electron中使用bootstrap
網(wǎng)站鏈接:http://bm7419.com/article36/iihpsg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、網(wǎng)站策劃定制網(wǎng)站、品牌網(wǎng)站建設(shè)、網(wǎng)站營(yíng)銷(xiāo)網(wǎng)頁(yè)設(shè)計(jì)公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)公司