我正在嘗試在我的 Angular 專案中安裝引導程式。
- 我曾經
npm install --save bootstrap在我的專案中安裝引導程式 - 之后我安裝了jquery
- 提供的引導路徑
下面是 angular.json 檔案:
"styles": [
"../node_modules/boostrap/dist/css/bootstrap.css",
"src/styles.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js"
]
當我在 style.css 中傳遞上述引導路徑時,它可以作業,但我想通過將路徑傳遞給 angular.json 來使其作業。
樣式.css 檔案@import "../node_modules/bootstrap/dist/css/bootstrap.css"
我嘗試的所有路徑都在下面提到:
“./node_modules/boostrap/dist/css/bootstrap.css”
“node_modules/boostrap/dist/css/bootstrap.css”
“../node_modules/boostrap/dist/css/bootstrap.css”
uj5u.com熱心網友回復:
在我的專案上,我有這樣的。
"./node_modules/boostrap/dist/css/bootstrap.css"
但請記住,如果您不停止服務并再次運行ng serve,它不會顯示更改,因為匯入是在 ng 服務程序開始時進行的。
希望對你有效。
如果您從原始配置的位置更改了 angular.json,請告訴我我們可以找出正確的路徑
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/521325.html
