Tlolela ho litaba tsa mantlha Tlolela ho li-docs navigation
Check
in English

Khoasolla

Khoasolla Bootstrap ho fumana CSS e hlophisitsoeng le JavaScript, khoutu ea mohloli, kapa u e kenye le batsamaisi ba liphutheloana tseo u li ratang joalo ka npm, RubyGems, le tse ling.

E hlophisitsoe ka CSS le JS

Khoasolla khoutu e hlophisitsoeng e seng e loketse ho sebelisoa bakeng sa Bootstrap v5.2.1 ho oela habonolo morerong oa hau, ho kenyelletsang:

Sena ha se kenyeletse litokomane, lifaele tsa mohloli, kapa litšepiso life kapa life tsa JavaScript tse kang Popper.

Khoasolla

Lifaele tsa mohloli

Kopanya Bootstrap ka phaephe ea hau ea thepa ka ho khoasolla mohloli oa rona oa Sass, JavaScript le lifaele tsa litokomane. Khetho ena e hloka lisebelisoa tse eketsehileng:

  • Sass compiler bakeng sa ho bokella lifaele tsa mohloli oa Sass ho lifaele tsa CSS
  • Autoprefixer bakeng sa CSS morekisi prefixing

Haeba u ka hloka lisebelisoa tsa rona tse felletseng tsa ho aha , li kenyellelitsoe bakeng sa ho nts'etsapele Bootstrap le litokomane tsa eona, empa mohlomong ha li tšoanelehe molemong oa hau.

Khoasolla mohloli

Mehlala

Haeba u batla ho khoasolla le ho hlahloba mehlala ea rona , u ka fumana mehlala e seng e hahiloe:

Kopitsa Mehlala

CDN ka jsDelivr

Tlohela ho khoasolla ka jsDelivr ho fana ka mofuta o bolokiloeng oa Bootstrap e hlophisitsoeng ea CSS le JS morerong oa hau.

<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>

Haeba u sebelisa JavaScript ea rona e hlophisitsoeng 'me u khetha ho kenyelletsa Popper ka thoko, eketsa Popper pele ho JS ea rona, ka CDN ka ho khetheha.

<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>

Batsamaisi ba liphutheloana

Hula lifaele tsa mohloli oa Bootstrap hoo e batlang e le projeke efe kapa efe e nang le batsamaisi ba liphutheloana tse tsebahalang haholo. Ho sa tsotelehe molaoli oa sephutheloana, Bootstrap e tla hloka moqapi oa Sass le Autoprefixer bakeng sa setup se lumellanang le liphetolelo tsa rona tse hlophisitsoeng tsa semmuso.

npm

Kenya Bootstrap lits'ebetsong tsa hau tsa Node.js ka sephutheloana sa npm :

npm install [email protected]

const bootstrap = require('bootstrap')kapa import bootstrap from 'bootstrap'e tla kenya li-plugins tsohle tsa Bootstrap holim'a bootstrapntho. Mojule bootstrapka boeona e romella li-plugins tsohle tsa rona. U ka kenya li-plugins tsa Bootstrap ka bomong ka ho kenya /js/dist/*.jslifaele tlas'a bukana ea boemo bo holimo ea sephutheloana.

Bootstrap's package.jsone na le metadata e 'ngoe e eketsehileng tlas'a linotlolo tse latelang:

  • sass- tsela ea faele ea mantlha ea Sass ea Bootstrap
  • style- tsela ea ho CSS ea Bootstrap e se nang minified e hlophisitsoeng ho sebelisoa litlhophiso tsa kamehla (ha ho na mokhoa oa ho etsa)
Qala ka Bootstrap ka npm ka projeke ea rona ea ho qala! Tlohela sebakeng sa polokelo ea template ea twbs/bootstrap-npm-starter ho bona mokhoa oa ho aha le ho etsa Bootstrap molemong oa hau oa npm. E kenyeletsa Sass compiler, Autoprefixer, Stylelint, PurgeCSS, le Bootstrap Icons.

khoele

Kenya Bootstrap lits'ebetsong tsa hau tsa Node.js ka sephutheloana sa khoele :

RubyGems

Kenya Bootstrap lits'ebetsong tsa hau tsa Ruby u sebelisa Bundler ( e khothalelitsoeng ) le RubyGems ka ho kenyelletsa mohala o latelang ho ea hau Gemfile:

gem 'bootstrap', '~> 5.2.1'

Ntle le moo, haeba u sa sebelise Bundler, u ka kenya lehakoe ka ho sebelisa taelo ena:

gem install bootstrap -v 5.2.1

Sheba lehakoe la README bakeng sa lintlha tse ling.

Moqapi

U ka kenya le ho laola Sass ea Bootstrap le JavaScript u sebelisa Composer :

composer require twbs/bootstrap:5.2.1

NuGet

Haeba o hlahisa .NET Framework, o ka kenya le ho laola CSS ea Bootstrap kapa Sass le JavaScript o sebelisa NuGet . Merero e mecha e lokela ho sebelisa libman kapa mokhoa o mong kaha NuGet e etselitsoe khoutu e hlophisitsoeng, eseng matlotlo a ka pele.

Install-Package bootstrap
Install-Package bootstrap.sass