Source

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 v4.2.1 ho oela habonolo morerong oa hau, ho kenyelletsang:

  • Liphutheloana tsa CSS tse kopantsoeng le tse fokolitsoeng (sheba papiso ea lifaele tsa CSS )
  • Li-plugins tsa JavaScript tse bokelletsoeng le tse ntlafalitsoeng

Sena ha se kenyeletse litokomane, lifaele tsa mohloli, kapa tse ling tse ka ikhethelang tsa JavaScript (jQuery le Popper.js).

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 (Libsass kapa Ruby Sass e tšehetsoa) bakeng sa ho bokella CSS ea hau.
  • Autoprefixer bakeng sa CSS morekisi prefixing

Ha o ka hloka lisebelisoa 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

jsDelivr

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

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

Haeba u sebelisa JavaScript ea rona e hlophisitsoeng, u seke oa lebala ho kenyelletsa mefuta ea CDN ea jQuery le Popper.js pele ho eona.

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" 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 bootstrap

require('bootstrap')e tla kenya li-plugins tsohle tsa Bootstrap tsa jQuery nthong ea jQuery. Mojule bootstrapka boeona ha e rekise letho kantle ho naha. U ka kenya li-plugins tsa jQuery tsa Bootstrap ka bo mong ka ho kenya /js/*.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 eo e seng ea mini-minified e seng e hlophisitsoe esale pele ho sebelisoa litlhophiso tsa kamehla (ha ho na tloaelo)

khoele

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

yarn add bootstrap

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', '~> 4.2.1'

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

gem install bootstrap -v 4.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:4.2.1

NuGet

Haeba u nts'etsapele ho .NET, u ka kenya le ho laola Bootstrap's CSS kapa Sass le JavaScript u sebelisa NuGet :

Install-Package bootstrap
Install-Package bootstrap.sass