Pitani kuzinthu zazikulu Pitani kumayendedwe adocs
Check
in English

Tsitsani

Tsitsani Bootstrap kuti mupeze CSS yophatikizidwa ndi JavaScript, khodi yoyambira, kapena muphatikize ndi oyang'anira phukusi omwe mumakonda monga npm, RubyGems, ndi zina zambiri.

Kuphatikizidwa kwa CSS ndi JS

Tsitsani khodi yokonzekera kugwiritsa ntchito ya Bootstrap v5.2.1 kuti mulowe mu polojekiti yanu, yomwe ikuphatikiza:

Izi sizikuphatikiza zolemba, mafayilo oyambira, kapena kudalira kulikonse kwa JavaScript ngati Popper.

Tsitsani

Mafayilo oyambira

Sungani Bootstrap ndi payipi yanuyanu potsitsa gwero lathu la Sass, JavaScript, ndi mafayilo olembedwa. Izi zimafuna zida zowonjezera:

Ngati mungafune zida zathu zonse zomangira , zikuphatikizidwa popanga Bootstrap ndi zolemba zake, koma mwina ndizosayenera pazolinga zanu.

Tsitsani gwero

Zitsanzo

Ngati mukufuna kutsitsa ndikuwunika zitsanzo zathu , mutha kutenga zitsanzo zomwe zamangidwa kale:

Koperani Zitsanzo

CDN kudzera pa jsDelivr

Lumphani kutsitsa ndi jsDelivr kuti mupereke mtundu wosungidwa wa Bootstrap wopangidwa ndi CSS ndi JS ku projekiti yanu.

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

Ngati mukugwiritsa ntchito JavaScript yathu yopangidwa ndipo mumakonda kuphatikiza Popper padera, onjezani Popper pamaso pa JS yathu, kudzera pa CDN makamaka.

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

Oyang'anira phukusi

Kokani mafayilo amtundu wa Bootstrap pafupifupi projekiti iliyonse yokhala ndi oyang'anira phukusi otchuka kwambiri. Ziribe kanthu woyang'anira phukusi, Bootstrap idzafuna compiler ya Sass ndi Autoprefixer pakukonzekera komwe kumagwirizana ndi mitundu yathu yovomerezeka.

npm

Ikani Bootstrap mu mapulogalamu anu a Node.js omwe ali ndi phukusi la npm :

npm install [email protected]

const bootstrap = require('bootstrap')kapena import bootstrap from 'bootstrap'adzatsegula mapulagini onse a Bootstrap pa bootstrapchinthu. Module bootstrapyokha imatumiza mapulagini athu onse. Mutha kuyika mapulagini a Bootstrap payekhapayekha pokweza /js/dist/*.jsmafayilo pansi pa chikwatu chapamwamba kwambiri.

Bootstrap's package.jsonili ndi metadata yowonjezera pansi pa makiyi awa:

  • sass- njira yopita ku fayilo yayikulu ya Sass ya Bootstrap
  • style- njira yopita ku CSS yosagwirizana ndi Bootstrap yomwe idapangidwa pogwiritsa ntchito zosintha (palibe makonda)
Yambani ndi Bootstrap kudzera npm ndi polojekiti yathu yoyambira! Mutu ku twbs/bootstrap-npm-starter template repository kuti muwone momwe mungamangire ndikusintha Bootstrap mu polojekiti yanu ya npm. Zimaphatikizapo Sass compiler, Autoprefixer, Stylelint, PurgeCSS, ndi Zithunzi za Bootstrap.

ulusi

Ikani Bootstrap mu mapulogalamu anu a Node.js omwe ali ndi phukusi la ulusi :

RubyGems

Ikani Bootstrap mu mapulogalamu anu a Ruby pogwiritsa ntchito Bundler ( yalimbikitsa ) ndi RubyGems powonjezera mzere wotsatira wanu Gemfile:

gem 'bootstrap', '~> 5.2.1'

Kapenanso, ngati simukugwiritsa ntchito Bundler, mutha kukhazikitsa mwala wamtengo wapatali poyendetsa lamulo ili:

gem install bootstrap -v 5.2.1

Onani zamtengo wapatali za README kuti mumve zambiri.

Wopeka

Mutha kukhazikitsanso ndikuwongolera Sass ya Bootstrap ndi JavaScript pogwiritsa ntchito Composer :

composer require twbs/bootstrap:5.2.1

NuGet

Ngati mukupanga NET Framework, mukhoza kukhazikitsa ndi kusamalira CSS ya Bootstrap kapena Sass ndi JavaScript pogwiritsa ntchito NuGet . Mapulojekiti atsopano akuyenera kugwiritsa ntchito libman kapena njira ina monga NuGet idapangidwira ma code, osati katundu wakutsogolo.

Install-Package bootstrap
Install-Package bootstrap.sass