我想添加一個引導程序加載項,即Bootstrap Toggle到JHipster項目。該項目包括一個.css
和.js
文件,並要求jQuery。向JHipster(Angular 2+)添加引導程序切換
簡單地添加到index.html
工作正常,但感覺哈克。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
我想利用紗線和webpack。我嘗試添加一個vendor.css
到其中進口切換css文件內容的文件夾,但似乎並沒有做任何事情:
@import 'node_modules/boostrap-toggle/css/bootstrap-toggle.css';
我怎樣才能從我的node_modules
文件夾中添加自舉切換(或者類似的庫)應用程序?
@RahulSingh我認爲你鏈接到了錯誤的問題。 – hschne
這可能是https://stackoverflow.com/q/45339209/2708210 –
重複我很抱歉。這個問題的答案解釋瞭如何使用第三方css或js –