Holo i ka ʻike nui Holo i ka hoʻokele docs
Check
in English

Hoʻoiho

Hoʻoiho iā Bootstrap e kiʻi i ka CSS i hui ʻia a me JavaScript, kumu kumu, a i ʻole e hoʻokomo pū me kāu mau pūʻulu punahele punahele e like me npm, RubyGems, a me nā mea hou aku.

CSS a me JS i houluuluia

Hoʻoiho i ke code i hoʻohui ʻia no Bootstrap v5.2.1 e hoʻoiho maʻalahi i kāu papahana, e komo pū ana:

ʻAʻole pili kēia i nā palapala, nā faila kumu, a i ʻole nā ​​mea hilinaʻi JavaScript e like me Popper.

Hoʻoiho

Nā waihona kumu

Hoʻopili i ka Bootstrap me kāu pipeline waiwai ponoʻī ma ka hoʻoiho ʻana i kā mākou kumu Sass, JavaScript, a me nā faila palapala. Pono kēia koho i kekahi mau mea hana hou:

Inā makemake ʻoe i kā mākou pūʻulu piha o nā mea hana kūkulu , ua hoʻokomo ʻia lākou no ka hoʻomohala ʻana iā Bootstrap a me kāna mau palapala, akā ʻaʻole kūpono lākou no kāu mau kumu ponoʻī.

Hoʻoiho i ke kumu

Nā laʻana

Inā makemake ʻoe e hoʻoiho a nānā i kā mākou mau laʻana , hiki iā ʻoe ke hopu i nā hiʻohiʻona i kūkulu ʻia:

Hoʻoiho i nā Laʻana

CDN ma o jsDelivr

Hoʻokuʻu i ka hoʻoiho ʻana me jsDelivr e hāʻawi i ka mana huna o kā Bootstrap CSS a me JS i hui pū ʻia i kāu papahana.

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

Inā ʻoe e hoʻohana nei i kā mākou JavaScript i hōʻuluʻulu ʻia a makemake ʻoe e hoʻokomo iā Popper i kahi kaʻawale, e hoʻohui iā Popper ma mua o kā mākou JS, ma o kahi CDN ʻoi aku ka maikaʻi.

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

Nā luna pūʻolo

Huki i nā faila kumu o Bootstrap i loko o kahi papahana me kekahi o nā mana hoʻokele kaulana loa. ʻAʻole pili i ka luna pūʻolo, e koi ʻo Bootstrap i kahi Sass compiler a me Autoprefixer no kahi hoʻonohonoho e kūlike i kā mākou mau mana i hōʻuluʻulu ʻia.

npm

E hoʻouka i ka Bootstrap i kāu mau polokalamu mana Node.js me ka pūʻolo npm :

npm install [email protected]

const bootstrap = require('bootstrap')a i ʻole import bootstrap from 'bootstrap'e hoʻouka i nā plugins a pau o Bootstrap i kahi bootstrapmea. ʻO ka bootstrapmodule ponoʻī e hoʻopuka i kā mākou plugins āpau. Hiki iā ʻoe ke hoʻouka lima i nā plugins Bootstrap i kēlā me kēia ma ka hoʻouka ʻana i nā /js/dist/*.jsfaila ma lalo o ka papa kuhikuhi kiʻekiʻe o ka pae.

Aia i loko o Bootstrap package.jsonkekahi mau metadata hou ma lalo o nā kī aʻe:

  • sass- ala i ka waihona kumu Sass nui o Bootstrap
  • style- ala i ka CSS non-minified o Bootstrap i hōʻuluʻulu ʻia me ka hoʻohana ʻana i nā hoʻonohonoho paʻamau (ʻaʻohe hana maʻamau)
E hoʻomaka me Bootstrap ma o npm me kā mākou papahana hoʻomaka! E poʻo i ka waihona twbs/bootstrap-npm-starter template e ʻike ai pehea e kūkulu ai a hoʻopilikino iā Bootstrap i kāu papahana npm ponoʻī. Loaʻa i ka Sass compiler, Autoprefixer, Stylelint, PurgeCSS, a me Bootstrap Icons.

wili

E hoʻouka i ka Bootstrap i kāu mau polokalamu mana Node.js me ka pūʻolo yarn :

RubyGems

E hoʻouka i ka Bootstrap i kāu mau polokalamu Ruby me ka hoʻohana ʻana iā Bundler ( manaʻo ʻia ) a me RubyGems ma ka hoʻohui ʻana i kēia laina i kāu Gemfile:

gem 'bootstrap', '~> 5.2.1'

ʻO kahi ʻē aʻe, inā ʻaʻole ʻoe e hoʻohana iā Bundler, hiki iā ʻoe ke hoʻokomo i ka gem ma ka holo ʻana i kēia kauoha:

gem install bootstrap -v 5.2.1

E ʻike i ka README o ka gem no nā kikoʻī hou aku.

Mea haku mele

Hiki iā ʻoe ke hoʻouka a hoʻokele iā Bootstrap's Sass a me JavaScript me ka hoʻohana ʻana i ka Composer :

composer require twbs/bootstrap:5.2.1

NuGet

Inā hoʻomohala ʻoe ma .NET Framework, hiki iā ʻoe ke hoʻouka a mālama i kā Bootstrap CSS a i ʻole Sass a me JavaScript me ka hoʻohana ʻana iā NuGet . Pono nā papahana hou e hoʻohana i ka libman a i ʻole kahi ala ʻē aʻe e like me ka NuGet i hoʻolālā ʻia no ka code i hōʻuluʻulu ʻia, ʻaʻole nā ​​​​waiwai mua.

Install-Package bootstrap
Install-Package bootstrap.sass