Tikiake
Tangohia a Bootstrap ki te tiki i te CSS me te JavaScript kua whakahiato, te waehere puna, me 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 v5.2.1 kia ngawari te taka ki to kaupapa, kei roto:
- He paihere CSS kua whakahiato me te whakaiti (tirohia te whakataurite o nga konae CSS )
- Ko nga taputapu JavaScript kua whakahiato me te whakaiti (tirohia te whakataurite o nga konae JS )
Karekau he tuhinga, he konae puna, me etahi atu momo whakawhirinaki JavaScript penei i a Popper.
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:
- Kaihanga Sass mo te whakahiato i nga konae punapuna a Sass ki nga konae CSS
- Autoprefixer mo te CSS kaihoko prefixing
Mena ka hiahia koe ki a maatau huinga taputapu hanga katoa, kua whakauruhia mo te whakawhanake i a Bootstrap me ona tuhinga, engari kaore pea e pai mo o kaupapa ake.
Tauira
Mena kei te hiahia koe ki te tango me te tirotiro i o maatau tauira , ka taea e koe te hopu i nga tauira kua oti te hanga:
CDN mā jsDelivr
Hurihia te tango me te jsDelivr ki te tuku i te putanga keteroki o te CSS me te JS kua whakahiato a Bootstrap ki to kaupapa.
<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>
Mena kei te whakamahi koe i ta maatau JavaScript kua whakahiato me te pai ki te whakauru i a Popper motuhake, taapirihia a Popper ki mua i to maatau JS, ma te CDN pai ake.
<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>
Kaiwhakahaere mōkihi
Toia mai nga konae puna a Bootstrap ki te tata ki tetahi 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 [email protected]
const bootstrap = require('bootstrap')
ka utaina ranei import bootstrap from 'bootstrap'
nga taputapu katoa a Bootstrap ki runga i tetahi bootstrap
mea. Ko te bootstrap
kōwae tonu ka kaweake i a tatou monomai katoa. Ka taea e koe te uta takitahi i nga monomai a Bootstrap ma te uta i nga /js/dist/*.js
konae kei raro i te raarangi taumata-runga o te kete.
Kei a Bootstrap package.json
etahi metadata taapiri i raro i nga taviri e whai ake nei:
sass
- ara ki te kōnae pūtake Sass matua a Bootstrapstyle
- ara ki te CSS kore-whakaitihia a Bootstrap i whakahiato ma te whakamahi i nga tautuhinga taunoa (kaore he whakaritenga)
miro
Tāutahia a Bootstrap ki roto i o taupānga Node.js me te kete miro :
yarn add [email protected]
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', '~> 5.2.1'
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 5.2.1
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:5.2.1
NuGet
Mena ka whakawhanake koe i roto i te .NET Framework, ka taea hoki e koe te whakauru me te whakahaere i te CSS a Bootstrap , Sass me JavaScript ma te whakamahi NuGet . Ko nga kaupapa hou ake me whakamahi i te libman , i tetahi atu tikanga ranei na te mea i hangaia a NuGet mo te waehere kua whakahiato, kaua ki nga rawa o mua.
Install-Package bootstrap
Install-Package bootstrap.sass