Yeqela kokuqukethwe okuyinhloko Yeqela ku-docs navigation
Check

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 v5.2.1 ukuze ungene kalula kuphrojekthi yakho, ehlanganisa:

Lokhu akubandakanyi amadokhumenti, amafayela omthombo, nanoma yikuphi ukuncika kwe-JavaScript ongakukhetha njenge-Popper.

Landa

Amafayela omthombo

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

Uma udinga isethi yethu egcwele yamathuluzi okwakha , afakwe ukuthuthukisa i-Bootstrap namadokhumenti ayo, kodwa cishe awafaneleki izinjongo zakho.

Landa umthombo

Izibonelo

Uma ufuna ukulanda futhi uhlole izibonelo zethu , ungathola izibonelo ezakhiwe kakade:

Landa Izibonelo

I-CDN nge-jsDelivr

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

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8" crossorigin="anonymous"></script>

Uma usebenzisa i-JavaScript yethu ehlanganisiwe futhi ukhetha ukufaka i-Popper ngokuhlukana, engeza i-Popper ngaphambi kwe-JS yethu, usebenzisa i-CDN okungcono kakhulu.

<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz" 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 ezihlanganisiwe ezisemthethweni.

npm

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

npm install [email protected]

const bootstrap = require('bootstrap')noma import bootstrap from 'bootstrap'izolayisha wonke ama-plugin e-Bootstrap bootstrapentweni. Imojula bootstrapngokwayo ithumela kwamanye amazwe wonke ama-plugin ethu. Ungakwazi ukulayisha mathupha ama-plugin e-Bootstrap ngawodwana ngokulayisha /js/dist/*.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 kusetshenziswa izilungiselelo ezizenzakalelayo (akukho ukwenza ngokwezifiso)
Qalisa nge-Bootstrap nge-npm ngephrojekthi yethu yokuqala! Hamba ku- twbs/bootstrap-npm-starter template repository ukuze ubone indlela yokwakha nokwenza ngokwezifiso i-Bootstrap kuphrojekthi yakho ye-npm. Kufaka phakathi i-Sass compiler, Autoprefixer, Stylelint, PurgeCSS, nezithonjana ze-Bootstrap.

ntambo

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

I-RubyGems

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

gem 'bootstrap', '~> 5.2.1'

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

gem install bootstrap -v 5.2.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:5.2.1

I-NuGet

Uma uthuthukisa ku-.NET Framework, ungaphinda ufake futhi uphathe i- CSS ye-Bootstrap noma i - Sass ne-JavaScript usebenzisa i - NuGet . Amaphrojekthi amasha kufanele asebenzise i -libman noma enye indlela njengoba i-NuGet yakhelwe ikhodi ehlanganisiwe, hhayi amafa angaphambili.

Install-Package bootstrap
Install-Package bootstrap.sass