Source

Landa

Landa i-Bootstrap ukuze uthole i-CSS ne-JavaScript ehlanganisiwe, ikhodi yomthombo, noma uyifake nabaphathi bakho bephakheji abayintandokazi njenge-npm, i-RubyGems, nokuningi.

I-CSS ehlanganisiwe ne-JS

Landa ikhodi ehlanganisiwe elungele ukusetshenziswa ye- Bootstrap v4.4.1 ukuze ungene kalula kuphrojekthi yakho, ehlanganisa:

Lokhu akubandakanyi amadokhumenti, amafayela omthombo, nanoma yikuphi ukuncika kwe-JavaScript ongakukhetha (i-jQuery ne-Popper.js).

Landa

Amafayela omthombo

Hlanganisa i-Bootstrap ngepayipi lakho lempahla ngokulanda umthombo wethu i-Sass, i-JavaScript, namafayela amadokhumenti. Le nketho idinga amathuluzi angeziwe:

Uma kwenzeka udinga amathuluzi okwakha , afakwe ukuze kuthuthukiswe i-Bootstrap kanye nemibhalo yayo, kodwa cishe awafaneleki izinjongo zakho.

Landa umthombo

jsDelivr

Yeqa ukulanda nge- jsDelivr ukuze ulethe inguqulo efakwe kunqolobane ye-Bootstrap ehlanganisiwe ye-CSS kanye ne-JS kuphrojekthi yakho.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

Uma usebenzisa i-JavaScript yethu ehlanganisiwe, ungakhohlwa ukufaka izinguqulo ze-CDN ze-jQuery ne-Popper.js ngaphambi kwayo.

<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>

Abaphathi bephakheji

Donsa amafayela womthombo we-Bootstrap cishe kunoma iyiphi iphrojekthi enabaphathi bephakheji abadume kakhulu. Kungakhathaliseki ukuthi ungumphathi wephakheji, i-Bootstrap izodinga i-Sass compiler kanye ne - Autoprefixer yokusetha okufana nezinguqulo zethu ezisemthethweni ezihlanganisiwe.

npm

Faka i-Bootstrap kuzinhlelo zakho zokusebenza ezinamandla ze-Node.js ngephakheji ye-npm :

npm install bootstrap

require('bootstrap')izolayisha wonke ama-plugin e-Bootstrap e-jQuery entweni ye-jQuery. Imojula bootstrapngokwayo ayikhiphi lutho. Ungakwazi ukulayisha mathupha ama-plugin e-Bootstrap e-jQuery ngawodwana ngokulayisha /js/*.jsamafayela ngaphansi kohla lwemibhalo lwezinga eliphezulu lephakheji.

I-Bootstrap's package.jsoniqukethe imethadatha eyengeziwe ngaphansi kokhiye abalandelayo:

  • sass- indlela eya kufayela lomthombo le -Bootstrap eliyinhloko le- Sass
  • style- indlela eya ku-CSS engancishisiwe ye-Bootstrap ehlanganiswe kusengaphambili kusetshenziswa izilungiselelo ezizenzakalelayo (akukho ukwenza ngokwezifiso)

ntambo

Faka i-Bootstrap kuzinhlelo zakho zokusebenza ezinamandla ze -Node.js ngephakheji yentambo :

yarn add bootstrap

I-RubyGems

Faka i-Bootstrap ezinhlelweni zakho zokusebenza ze-Ruby usebenzisa i - Bundler ( kunconyiwe ) kanye ne - RubyGems ngokwengeza umugqa olandelayo kweyakho Gemfile:

gem 'bootstrap', '~> 4.4.1'

Kungenjalo, uma ungasebenzisi i-Bundler, ungafaka igugu ngokusebenzisa lo myalo:

gem install bootstrap -v 4.4.1

Bona igugu elithi README ukuze uthole imininingwane eyengeziwe.

Umqambi

Ungakwazi futhi ukufaka nokuphatha i-Bootstrap's Sass ne-JavaScript usebenzisa i- Composer :

composer require twbs/bootstrap:4.4.1

I-NuGet

Uma uthuthuka ku-.NET, ungaphinda ufake futhi uphathe i-Bootstrap's CSS noma i - Sass ne-JavaScript usebenzisa i- NuGet :

Install-Package bootstrap
Install-Package bootstrap.sass