Source

Budata

Budata Bootstrap iji nweta CSS na Javascript achịkọtara, koodu isi mmalite, ma ọ bụ tinye ya na ndị njikwa ngwugwu ọkacha mmasị gị dị ka npm, RubyGems na ndị ọzọ.

Achịkọtara CSS na JS

Budata koodu achịkọtara ejikere maka Bootstrap v4.0.0 ka itinye ngwa ngwa n'ime ọrụ gị, nke gụnyere:

  • Ngwungwu CSS achịkọtara na nke pere mpe (lee ntụnyere faịlụ CSS )
  • Ngwa mgbakwunye Javascript achịkọtara na nke pere mpe

Nke a anaghị agụnye akwụkwọ, faịlụ isi mmalite, ma ọ bụ ndabere Javascript nhọrọ ọ bụla (jQuery na Popper.js).

Budata

Isi mmalite faịlụ

Jiri pipeline akụ nke gị chịkọta Bootstrap site na nbudata isi iyi Sass, Javascript na faịlụ akwụkwọ. Nhọrọ a chọrọ ụfọdụ ngwa mgbakwunye:

  • Sass compiler (Libsass ma ọ bụ Ruby Sass na-akwado) maka ịchịkọta CSS gị.
  • Autoprefixer maka prefixer onye na-ere CSS

Ọ bụrụ na ịchọrọ ihe nrụpụta , etinyere ha maka ịmepụta Bootstrap na docs ya, mana ọ ga-abụ na ha agaghị adabara ebumnuche nke gị.

Budata isi iyi

jsDelivr

Jiri jsDelivr mafee nbudata ahụ iji wepụta ụdị nke Bootstrap achịkọtara CSS na JS n'ọrụ gị.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

Ọ bụrụ na ị na-eji Javascript anyị achịkọtara, echefula itinye ụdị CDN nke jQuery na Popper.js n'ihu ya.

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>

Ndị njikwa ngwugwu

Bubata faịlụ isi mmalite Bootstrap n'ime ihe fọrọ nke nta ka ọ bụrụ ọrụ ọ bụla nwere ụfọdụ njikwa ngwugwu kachasị ewu ewu. N'agbanyeghị onye njikwa ngwugwu, Bootstrap ga- achọ Sass compiler na Autoprefixer maka nhazi nke dabara na ụdị anyị achịkọtara.

npm

Wụnye Bootstrap na ngwa Node.js gị nwere ngwugwu npm :

npm install bootstrap

require('bootstrap')ga-ebunye ihe mgbakwunye jQuery Bootstrap na ihe jQuery. Modul bootstrapn'onwe ya anaghị ebupụ ihe ọ bụla. Ị nwere ike iji aka buo Bootstrap's jQuery plugins n'otu n'otu site na ịkwanye /js/*.jsfaịlụ ndị dị n'okpuru akwụkwọ ndekọ aha dị elu nke ngwugwu.

Bootstrap package.jsonnwere ụfọdụ metadata agbakwunyere n'okpuru igodo ndị a:

  • sass- ụzọ isi Bootstrap isi faịlụ Sass
  • style- ụzọ na-aga Bootstrap CSS na-abụghị nke a chịkọtara nke ọma site na iji ntọala ndabara (enweghị nhazi)

RubyGems

Wụnye Bootstrap na ngwa Ruby gị site na iji Bundler ( akwadoro ) na RubyGems site na ịgbakwunye ahịrị ndị a na gị Gemfile:

gem 'bootstrap', '~> 4.0.0'

N'aka nke ọzọ, ọ bụrụ na ị naghị eji Bundler, ị nwere ike ịwụnye gem site na iji iwu a:

gem install bootstrap -v 4.0.0

Hụ ọnụ ahịa README maka nkọwa ndị ọzọ.

Onye na-ede ihe

Ị nwekwara ike iwunye ma jikwaa Bootstrap's Sass na JavaScript site na iji Onye na-ede ihe :

composer require twbs/bootstrap:4.0.0

NuGet

Ọ bụrụ na ịmalite na NET, ị nwekwara ike ịwụnye ma jikwaa Bootstrap's CSS ma ọ bụ Sass na JavaScript site na iji NuGet :

Install-Package bootstrap
Install-Package bootstrap.sass