Cov txheej txheem:

Yuav ua li cas kuv ntxiv bootstrap 4 rau react app?
Yuav ua li cas kuv ntxiv bootstrap 4 rau react app?

Video: Yuav ua li cas kuv ntxiv bootstrap 4 rau react app?

Video: Yuav ua li cas kuv ntxiv bootstrap 4 rau react app?
Video: ua neej tiam no tsis cia siab lawm ( zoo xyooj ) C.V 2024, Kaum ib hlis
Anonim

Ntxiv Bootstrap hauv Teb Siv NPM

Tom qab kev txhim kho tus bootstrap pob, koj yuav tau ntshuam nws hauv koj React app cov ntaub ntawv nkag. Tom ntej no, mus rau src/index. js ntaub ntawv thiab ntxiv cov nram qab no imports: ntshuam $ los ntawm 'jquery'; ntshuam Popper los ntawm 'popper.

Xav txog qhov no, kuv tuaj yeem siv cov tshuaj tiv thaiv nrog bootstrap?

Koj tuaj yeem siv Bootstrap ncaj qha rau cov khoom thiab cov khoom hauv koj Teb app los ntawm kev siv cov chav kawm built-in ib yam li lwm chav kawm. Cia peb tsim lub ntsiab lus hloov pauv yooj yim Teb tiv thaiv kom pom siv Bootstrap cov chav kawm thiab cov khoom siv.

Tsis tas li ntawd, kuv yuav muab cov qauv hauv ReactJS li cas? Integrate Admin Template Hauv ReactJS

  1. Kauj ruam 1: Configure ib reactjs app. Raws li nws cov ntaub ntawv qub, peb yuav tsum tau nruab thoob ntiaj teb tsim-react-app thoob ntiaj teb.
  2. Kauj ruam 2: suav tag nrho cov ntaub ntawv css thiab js.
  3. Kauj ruam 3: Ua Header tivthaiv rau tus admin template.
  4. Kauj ruam 4: Ua ib tug sidebar tivthaiv.
  5. Kauj Ruam 5: Ua ib lub ntsiab lus.

Hais txog qhov no, kuv yuav ua li cas rau nruab Reactstrap?

Ntxiv Bootstrap

  1. import 'bootstrap/dist/css/bootstrap. css';
  2. import { Khawm } los ntawm 'reactstrap'; Tam sim no koj npaj txhij siv cov khoom siv reactstrap txawv teb chaws nyob rau hauv koj qhov kev tivthaiv hierarchy teev nyob rau hauv txoj kev ua.
  3. npm install.
  4. npm pib.
  5. npm tes.
  6. npm run test-watch.
  7. ./scripts/release
  8. ./scripts/publish.

Yuav ua li cas koj thiaj li ua tau ib qho app react?

Pib Pib: Pib nrog Teb yog qhov yooj yim. Tom qab nws tau nruab, koj tuaj yeem khiav lub tsim - teb - app ntawm kab hais kom ua, ua raws li lub npe ntawm tus app koj xav tau tsim . Qhov no tsim cov react app , nrog tag nrho cov tsim nyog functionality koj xav tau, twb tau ua rau hauv lub app.

Pom zoo: