vue项目中使用bootstrap4样式

2020年7月4日 18:43 by wst

bootstrap

前言

看过bootstrap4教程之后, 打算在vue项目中使用其样式。

经过调研,发现有集成好的插件bootstrap-vue,但看完BootstrapVue教程之后,感觉还是麻烦,组件标签变了,标签属性也变了又增加我的记忆负担。

我的目的很简单,只使用bootstrap4的样式。有如下方法:

1. 在index的head中引用bootstrap4的样式文件,代码中直接使用。

缺点:引用路径容易出问题,且最终部署是编译后的文件,路径更不容易把握;

2. 在main.js中引用css文件。

缺点:由于刚开始使用,暂未发现;

实现步骤

1. 安装vue,具体步骤这不再赘述,不会的详见vue安装教程

2. 安装bootstrap库:npm install  bootstrap

3. 在代码(mian.js)中引入:

import Vue from 'vue'
// import {BootstrapVue, IconsPlugin} from 'bootstrap-vue'
import App from './App.vue'

// Vue.use(BootstrapVue)
// Vue.use(IconsPlugin)
Vue.config.productionTip = false

import 'bootstrap/dist/css/bootstrap.css'
// import 'bootstrap-vue/dist/bootstrap-vue.css'

new Vue({
  render: h => h(App),
}).$mount('#app')

4. 在组件Search.vue中使用样式(如:class="jumbotron"):

<template>
    <div class="jumbotron">
            <div>
                <form>
                    <label for="exampleUsername">Search Github Users</label>
                    <div class="row">
                        <div class="col-6">
                            <div class="form-group">
                                <input type="text" class="form-control" id="exampleUsername">
                            </div>
                        </div>
                        <div class="col-6">
                            <button type="submit" class="btn border">提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
</template>

 

福利:完整代码见vue-bootstrap4


Comments(126) Add Your Comment

Kevingaw
https://images.google.sc/url?q=https://schlossgut.de/news/welche_online_casinos_sind_in_deutschland_legal__1.html http://band-merch.de/wp-content/pages/wie_man_ein_online_casino_oder_einen_verdopplungsplan__berlistet.html http://maps.google.at/url?q=https://nething.com/wp-includes/pages/?wie_man_an_casino_spielautomaten_gewinnt_und_spielautomaten_richtig_spielt__schemata_und_strategien.html https://www.google.mg/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CC4QFjAA&url=http://justinekeptcalmandwentvegan.com/wp-content/pages/welches_online_casino_ist_zu_empfehlen___online_casinos_mit_guter_rendite_2022_.html https://www.csd-leipzig.de/wp-content/plugins/ninja-form/altersbeschr_nkungen_beim_gl_cksspiel__wie_alt_darf_man_in_casinos_in_verschiedenen_l_ndern_sein_.html
Izbrfq
order lipitor 20mg generic <a href="https://lipiws.top/">buy lipitor 80mg without prescription</a> order lipitor 80mg pill
Dpnmkj
cipro 500mg for sale - <a href="https://cipropro.top/">buy cipro 500mg sale</a> augmentin generic
Rzhrxz
buy ciprofloxacin 1000mg generic - <a href="https://metroagyl.top/cefaclor/">cost keflex 125mg</a> clavulanate pill
Tpkhct
buy generic metronidazole over the counter - <a href="https://metroagyl.top/azithromycin/">zithromax 500mg cheap</a> azithromycin without prescription
Gtxhqz
buy ciplox generic - <a href="https://septrim.top/trimox/">buy amoxicillin 250mg generic</a> erythromycin us
Mwllim
valacyclovir 500mg tablet - <a href="https://gnantiviralp.com/zovirax/">buy acyclovir 800mg pills</a> order zovirax 400mg online
Ezmxqs
ivermectin drug - <a href="https://keflexin.top/cefixime/">suprax generic</a> sumycin online order
Emnsfp
flagyl 400mg price - <a href="https://metroagyl.top/oxytetracycline/">terramycin 250 mg ca</a> brand zithromax 500mg
Mucjkt
buy generic ampicillin online <a href="https://ampiacil.top/amoxil500/">amoxicillin uk</a> amoxicillin drug
Lduodp
furosemide 40mg drug - <a href="https://antipathogenc.com/minipressm/">generic minipress 1mg</a> captopril 25mg cheap
Deglon
glycomet 1000mg ca - <a href="https://gnantiacidity.com/septra/">purchase septra generic</a> order lincocin 500mg online
Cdzirx
retrovir 300 mg drug - <a href="https://canadiangnp.com/avapro/">purchase irbesartan without prescription</a> buy allopurinol online cheap
Tdkgbs
clozapine pills - <a href="https://genonlinep.com/altace/">buy altace 10mg sale</a> cost famotidine 20mg
Zklmug
seroquel 50mg us - <a href="https://gnkantdepres.com/eskalith/">eskalith online order</a> how to get eskalith without a prescription
Udtqme
purchase anafranil online - <a href="https://antdeponline.com/abilify/">buy cheap generic aripiprazole</a> doxepin 75mg pill
Tncblb
buy atarax 25mg for sale - <a href="https://antdepls.com/">order atarax 25mg without prescription</a> buy endep 25mg online
Evqmbi
buy augmentin 1000mg online - <a href="https://atbioinfo.com/ciprofloxacin/">ciprofloxacin tablet</a> order cipro 500mg pill
Sqqpcw
generic amoxicillin - <a href="https://atbioxotc.com/cefadroxil/">buy duricef pills for sale</a> buy ciprofloxacin 1000mg pills
Nramez
cleocin pills - <a href="https://cadbiot.com/cefpodoxime/">vantin 100mg price</a> cheap generic chloramphenicol
Nbnzey
zithromax buy online - <a href="https://gncatbp.com/ctinidazole/">buy tindamax 500mg</a> ciprofloxacin 500 mg tablet
Aaszlk
ivermectin 6 mg for humans - <a href="https://antibpl.com/ascefaclor/">buy cefaclor 250mg sale</a> purchase cefaclor online
Nfteyh
cheap ventolin - <a href="https://antxallergic.com/">buy albuterol 2mg online</a> theo-24 Cr tablet
Bpccrl
order desloratadine 5mg generic - <a href="https://rxtallerg.com/getzaditor/">order zaditor generic</a> get allergy pills online
Nodvgc
buy methylprednisolone medication - <a href="https://ntallegpl.com/getcetirizine/">buy cheap zyrtec</a> order azelastine 10 ml sale
Zumvnp
order glyburide 5mg without prescription - <a href="https://prodeprpl.com/">cost micronase</a> buy generic forxiga
Viljqk
order repaglinide 1mg pills - <a href="https://depressinfo.com/">generic repaglinide 1mg</a> empagliflozin 25mg us
Zmwrtg
generic glucophage - <a href="https://arxdepress.com/sitagliptin50/">sitagliptin tablet</a> buy acarbose 25mg pills
Kohkiz
buy lamisil 250mg pill - <a href="https://treatfungusx.com/fulvicin250mg/">order griseofulvin 250mg pills</a> buy griseofulvin tablets
Khvgwu
buy rybelsus 14 mg - <a href="https://infodeppl.com/ddavpspray/">buy DDAVP spray</a> DDAVP cheap
Vbflpr
order ketoconazole 200 mg online cheap - <a href="https://antifungusrp.com/butenafinecream/">butenafine price</a> how to buy itraconazole
Yvsoxm
famciclovir 500mg tablet - <a href="https://amvinherpes.com/">famvir 500mg usa</a> buy valaciclovir no prescription
Lxaxzs
digoxin 250 mg price - <a href="https://blpressureok.com/">digoxin 250 mg cheap</a> buy lasix 100mg generic
Xfoxuf
order hydrochlorothiazide 25mg generic - <a href="https://norvapril.com/amlodipine/">order amlodipine 5mg online cheap</a> order zebeta 5mg
Ubqxvt
order metoprolol 50mg pills - <a href="https://bloodpresspl.com/propranolol/">inderal 20mg tablet</a> buy adalat
Ikdcbj
nitroglycerin for sale - <a href="https://nitroproxl.com/clonidinechlorthalidone/">combipres without prescription</a> valsartan pills
Gjlvoj
rosuvastatin thick - <a href="https://antcholesterol.com/caduet5mg/">caduet pills meat</a> caduet worm
Bvcduo
zocor universal - <a href="https://canescholest.com/gemfibrozil/">purchase lopid generic</a> atorvastatin mine
Gzjqls
viagra professional online whilst - <a href="https://edsildps.com/eriacta/">eriacta rule</a> levitra oral jelly online estate
Dsrbdt
priligy cheek - <a href="https://promedprili.com/viagraplus/">viagra plus apart</a> cialis with dapoxetine scowl
Zjgclc
cenforce solid - <a href="https://xcenforcem.com/zenegrasildenafil/">zenegra online dusk</a> brand viagra pills father
Sokdti
brand cialis believe - <a href="https://probrandtad.com/alprostadilonline/">alprostadil william</a> penisole communication
Llgjfp
cialis soft tabs pills saint - <a href="https://supervalip.com/cialisoraljelly/">cialis oral jelly online sister</a> viagra oral jelly online burst
Bvyzas
brand cialis messenger - <a href="https://probrandtad.com/brandlevitra/">brand levitra such</a> penisole ghastly
Dsvytk
cialis soft tabs online feeble - <a href="https://supervalip.com/cialisoraljelly/">cialis oral jelly pills acquaintance</a> viagra oral jelly lad
Wkiuej
cenforce online standard - <a href="https://xcenforcem.com/tadaciptadalafil/">tadacip pills feeble</a> brand viagra online want
Nvsfjn
acne medication security - <a href="https://placnemedx.com/">acne treatment glisten</a> acne medication estate
Cywzng
asthma medication witch - <a href="https://bsasthmaps.com/">asthma treatment passe</a> inhalers for asthma tight
Pulzbn
uti medication very - <a href="https://amenahealthp.com/">treatment for uti invite</a> uti treatment bit
Syjrtx
prostatitis pills skill - <a href="https://xprosttreat.com/">prostatitis medications galaxy</a> prostatitis pills terrace
Jtuyms
valacyclovir online success - <a href="https://gnantiviralp.com/">valtrex online flutter</a> valacyclovir pills key
Jeuydo
loratadine medication chief - <a href="https://clatadine.top/">loratadine medication instinct</a> claritin along
Srcqmn
dapoxetine aspect - <a href="https://prilixgn.top/">dapoxetine problem</a> dapoxetine greet
Zwjqkk
claritin pills heel - <a href="https://clatadine.top/">loratadine seize</a> claritin include
Urstmx
promethazine incident - <a href="https://prohnrg.com/">promethazine absurd</a> promethazine older
Qthtll
ascorbic acid range - <a href="https://ascxacid.com/">ascorbic acid cunning</a> ascorbic acid cloth
Wvcbqu
clarithromycin myth - <a href="https://gastropls.com/ranitidineonline/">zantac kitchen</a> cytotec unpleasant
Ctpepz
fludrocortisone pills lone - <a href="https://gastroplusp.com/propantoprazole/">protonix pills alive</a> prevacid port
Umqwso
dulcolax for sale - <a href="https://gastroinfop.com/">dulcolax 5mg cost</a> buy generic liv52 10mg
Bqqzph
cost rabeprazole 20mg - <a href="https://gastrointesl.com/metoclopramide/">buy metoclopramide generic</a> buy motilium pills
Gjdlhn
buy bactrim without a prescription - <a href="https://cotrioxazo.com/">order cotrimoxazole 480mg for sale</a> tobrex price
Surtye
order generic zovirax - <a href="https://danaterone.shop/">order hydroquinone</a> order generic duphaston 10mg
Fwdbss
forxiga 10mg usa - <a href="https://sineqpin.com/">order doxepin 75mg</a> precose ca
Pogokr
order griseofulvin 250 mg generic - <a href="https://fulviseoful.com/">buy fulvicin 250 mg pills</a> order lopid generic
Nrktgz
dimenhydrinate 50mg cheap - <a href="https://prasilx.com/">buy prasugrel</a> order actonel 35 mg for sale
Mtbjvl
order enalapril 10mg pills - <a href="https://xalanoprost.com/">buy xalatan paypal</a> purchase xalatan eye drops
Voeuaq
order monograph 600 mg without prescription - <a href="https://etodograph.com/">oral monograph 600mg</a> buy pletal no prescription
Hhwgnu
feldene price - <a href="https://feldexicam.com/">buy feldene 20mg sale</a> exelon 3mg us
Pbosbv
buy nootropil - <a href="https://nootquin.com/praziquantel/">buy biltricide tablets</a> sinemet buy online
Hqaxph
buy hydroxyurea cheap - <a href="https://hydroydrinfo.com/methocarbamol/">robaxin drug</a> cost methocarbamol
Sdkyot
divalproex 500mg without prescription - <a href="https://adepamox.com/acetazolamide/">buy acetazolamide 250 mg</a> topamax 200mg oral
Erhowe
order norpace generic - <a href="https://anorpica.com/">cheap norpace pill</a> thorazine 100mg drug
Ploxjm
cyclophosphamide uk - <a href="https://cycloxalp.com/atomoxetine/">strattera drug</a> buy trimetazidine pill
Lcgkyr
purchase aldactone pill - <a href="https://aldantinep.com/phenytoin/">dilantin order online</a> naltrexone 50 mg without prescription
Tfxnsk
buy flexeril 15mg generic - <a href="https://abflequine.com/">flexeril oral</a> enalapril 10mg cheap
Mswnqi
zofran 8mg price - <a href="https://azofarininfo.com/ropinirole/">requip 1mg oral</a> buy ropinirole 1mg online cheap
Sifnsx
ascorbic acid for sale - <a href="https://mdacidinfo.com/bromhexine/">bromhexine for sale</a> purchase compro for sale
Mygsvq
durex gel where to buy - <a href="https://xalaplinfo.com/">order durex gel online</a> brand latanoprost
Mskekl
rogaine price - <a href="https://hairlossmedinfo.com/finasteridehl/">propecia 5mg generic</a> finpecia tablet
Jvoggc
arava 20mg price - <a href="https://infohealthybones.com/risedronate/">actonel 35mg pill</a> order cartidin generic
Ijkyoe
cost tenormin 50mg - <a href="https://heartmedinfox.com/">tenormin medication</a> buy coreg sale
Xjhzso
order verapamil 120mg online - <a href="https://infoheartdisea.com/">calan medication</a> tenoretic over the counter
Eflllk
atorvastatin buy online - <a href="https://infoxheartmed.com/lisinopril/">order lisinopril sale</a> bystolic pills
Oflcpx
buy lasuna online - <a href="https://infoherbalmz.com/himcolin/">himcolin tablets</a> himcolin without prescription
Ibsmpz
buy gasex medication - <a href="https://herbalinfomez.com/diabecon/">diabecon cheap</a> brand diabecon
Ctzlse
noroxin order - <a href="https://gmenshth.com/confido/">confido order online</a> confido usa
Ikuugh
buy finax generic - <a href="https://finmenura.com/kamagra/">buy sildenafil 200mg online</a> alfuzosin 10 mg canada
Ncetcx
speman over the counter - <a href="https://spmensht.com/">how to get speman without a prescription</a> how to buy finasteride
Ndilbx
order hytrin online cheap - <a href="https://hymenmax.com/tamsulosin/">flomax 0.2mg cost</a> dapoxetine for sale
Hhrcds
order trileptal 300mg pills - <a href="https://trileoxine.com/levothyroxine/">synthroid 75mcg uk</a> cheap levothroid pills
Scbpfe
imusporin tubes - <a href="https://asimusxate.com/gloperba/">buy generic colcrys over the counter</a> colchicine 0.5mg price
Tzmhjy
oral duphalac - <a href="https://duphalinfo.com/mentat/">brahmi over the counter</a> buy betahistine 16mg generic
Tynmqp
buy deflazacort tablets - <a href="https://lazacort.com/brimonidine/">buy cheap brimonidine</a> buy generic brimonidine online
Jjuxtb
besifloxacin oral - <a href="https://besifxcist.com/carbocysteine/">carbocysteine for sale online</a> how to get sildamax without a prescription
Pypzfn
neurontin order online - <a href="https://aneutrin.com/ibuprofen/">ibuprofen 600mg oral</a> order sulfasalazine 500 mg pills
Dbkrms
generic probenecid 500mg - <a href="https://bendoltol.com/">buy generic benemid over the counter</a> buy carbamazepine 200mg online
Nczvpz
order celecoxib generic - <a href="https://celespas.com/flavoxate/">buy generic flavoxate</a> indomethacin cost
Peycne
mebeverine 135mg canada - <a href="https://coloxia.com/">buy generic mebeverine 135 mg</a> generic pletal 100mg
Hjyofy
purchase diclofenac generic - <a href="https://dicloltarin.com/aspirin/">buy aspirin pills</a> aspirin without prescription
Fhdqen
order rumalaya sale - <a href="https://rumaxtol.com/">rumalaya price</a> amitriptyline without prescription
Ewvedj
pyridostigmine oral - <a href="https://mestonsx.com/">mestinon 60 mg oral</a> azathioprine pills
Rjsoaq
buy generic diclofenac over the counter - <a href="https://vovetosa.com/animodipine/">nimotop without prescription</a> cheap nimotop without prescription
Ztwpar
ozobax tablet - <a href="https://baclion.com/nspiroxicam/">feldene sale</a> order feldene online cheap
Vupjcv
cyproheptadine 4 mg over the counter - <a href="https://periheptadn.com/aszanaflex/">zanaflex sale</a> purchase tizanidine online cheap
Mlvpsj
mobic 15mg over the counter - <a href="https://meloxiptan.com/">order meloxicam 7.5mg online</a> where can i buy toradol
Uoqwzi
where can i buy artane - <a href="https://voltapll.com.com/">trihexyphenidyl over the counter</a> purchase diclofenac gel for sale
Sgmukm
omnicef order online - <a href="https://omnixcin.com/clindamycin/">buy generic cleocin</a> cleocin uk
Jzvwry
order isotretinoin generic - <a href="https://aisotane.com/">accutane drug</a> buy deltasone 20mg generic
Nhdonn
buy deltasone for sale - <a href="https://apreplson.com/prednisolone/">order omnacortil 40mg pill</a> zovirax cost
Yhydqw
purchase acticin for sale - <a href="https://actizacs.com/">purchase permethrin without prescription</a> tretinoin order
Xisjrs
buy flagyl 200mg online cheap - <a href="https://ametronles.com/">flagyl 400mg sale</a> order cenforce for sale
Nvfrwd
order cleocin 300mg for sale - <a href="https://clinycinpl.com/">cleocin 150mg cheap</a> order generic indomethacin 75mg
Urzjay
buy cozaar 25mg sale - <a href="https://cozartan.com/">purchase hyzaar generic</a> purchase cephalexin for sale
Hdltom
crotamiton usa - <a href="https://aeuracream.com/abactroban/">bactroban ointment canada</a> buy cheap aczone
Raterv
modafinil usa - <a href="https://sleepagil.com/">provigil 200mg for sale</a> melatonin drug
Emncti
buy generic zyban - <a href="https://bupropsl.com/orlistat/">order orlistat 120mg for sale</a> cheap shuddha guggulu pills
Kzudqz
buy capecitabine 500mg online - <a href="https://xelocap.com/danocrine/">generic danazol 100mg</a> buy danocrine pills for sale
Khesjp
buy prometrium 100mg for sale - <a href="https://apromid.com/clomiphene/">order serophene pills</a> clomiphene price
Kqucyg
order fosamax online - <a href="https://pilaxmax.com/">fosamax 35mg cost</a> medroxyprogesterone 10mg price
Yrsrcc
aygestin price - <a href="https://norethgep.com/">norethindrone 5 mg usa</a> buy generic yasmin online
Lcsiqp
order estradiol 2mg pill - <a href="https://festrolp.com/anastrozole/">order anastrozole 1mg for sale</a> buy arimidex pill
Stryzw
buy cabergoline sale - <a href="https://adostilin.com/alesse/">cheap alesse for sale</a> how to buy alesse
Rymvxs
гѓ—гѓ¬гѓ‰гѓ‹гѓійЂљиІ© - <a href="https://jpaonlinep.com/jamoxicillin/">г‚ўгѓўг‚­г‚·г‚·гѓЄгѓігЃЇи–¬е±ЂгЃ§иІ·гЃ€г‚‹пјџ</a> г‚ёг‚№гѓ­гѓћгѓѓг‚ЇйЂљиІ©гЃЉгЃ™гЃ™г‚Ѓ
Ddlrnv
バイアグラ通販 安全 - <a href="https://jpedpharm.com/">バイアグラ通販 安全</a> タダラフィル どこで買える
Rzfwzz
正規品プレドニン錠の正しい処方 - <a href="https://jpanfarap.com/">プレドニン 飲み方</a> イソトレチノイン 市販 おすすめ
Jwzldo
eriacta spider - <a href="https://eriagra.com/">eriacta lord</a> forzest tent