Source

Tikiake

Tangohia a Bootstrap ki te tiki i te CSS me te JavaScript kua whakahiato, te waehere puna, te whakauru ranei ki o kaiwhakahaere kete tino pai penei i te npm, RubyGems, me etahi atu.

CSS me JS kua whakahiato

Tikiakehia te waehere kua whakahiatohia mo te Bootstrap v4.0.0 kia ngawari te taka ki to kaupapa, kei roto:

Karekau he tuhinga, he konae puna, me etahi atu momo whakawhirinaki JavaScript (jQuery me Popper.js).

Tikiake

Kōnae puna

Whakahiatohia a Bootstrap me o ake paipa rawa ma te tango i ta maatau punaha Sass, JavaScript, me nga konae tuhinga. Ko tenei whiringa ka hiahia etahi taputapu taapiri:

Mena ka hiahia koe ki te hanga taputapu , kua whakauruhia mo te whakawhanake i a Bootstrap me ona tuhinga, engari kaore pea e pai mo o kaupapa ake.

Tikiake puna

jsDelivr

Hurihia te tango me te jsDelivr ki te tuku putanga keteroki o te CSS me te JS kua whakahiatohia e Bootstrap ki to kaupapa.

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

Mena kei te whakamahi koe i ta maatau JavaScript kua whakahiato, kaua e wareware ki te whakauru i nga putanga CDN o jQuery me Popper.js i mua.

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

Kaiwhakahaere mōkihi

Toia mai nga konae puna a Bootstrap ki te tata ki nga kaupapa me etahi o nga kaiwhakahaere kete rongonui. Ahakoa te kaiwhakahaere o te kete, ka hiahia a Bootstrap ki te Kaihanga Sass me te Autoprefixer mo te tatūnga e rite ana ki a maatau putanga whakahiato mana.

npm

Tāutahia a Bootstrap ki roto i o taupānga Node.js whai mana me te kete npm :

npm install bootstrap

require('bootstrap')ka utaina nga taputapu jQuery katoa a Bootstrap ki runga i te ahanoa jQuery. Ko te bootstrapkōwae ake e kore e kaweake i tetahi mea. Ka taea e koe te uta i nga taputapu jQuery a Bootstrap takitahi ma te uta i nga /js/*.jskonae kei raro i te raarangi taumata-runga o te kete.

Kei a Bootstrap package.jsonetahi metadata taapiri i raro i nga taviri e whai ake nei:

  • sass- ara ki te kōnae pūtake Sass matua a Bootstrap
  • style- ara ki te CSS kore-whakaitihia a Bootstrap i whakahiatohia ma te whakamahi i nga tautuhinga taunoa (kaore he whakaritenga)

RubyGems

Tāutahia a Bootstrap ki o taupānga Ruby ma te whakamahi i te Bundler ( e taunaki ana ) me te RubyGems ma te taapiri i te rarangi e whai ake nei ki to Gemfile:

gem 'bootstrap', '~> 4.0.0'

I tua atu, ki te kore koe e whakamahi i te Bundler, ka taea e koe te whakauru i te kohatu ma te whakahaere i tenei whakahau:

gem install bootstrap -v 4.0.0

Tirohia te README o te kohatu mo etahi atu korero.

Kaitito

Ka taea hoki e koe te whakauru me te whakahaere i a Bootstrap's Sass me JavaScript ma te whakamahi i te Composer :

composer require twbs/bootstrap:4.0.0

NuGet

Mena ka whakawhanake koe i roto i te .NET, ka taea hoki e koe te whakauru me te whakahaere i te CSS a Bootstrap , Sass me JavaScript ma te whakamahi i te NuGet :

Install-Package bootstrap
Install-Package bootstrap.sass