Vue3.0 + Vite 使用 Bootstrap

使用 Vite 構建 Vue3.0 項目並嘗試使用 Bootstrapcss


這裏不會去寫 如何使用 Vite 如何構建 Vue3.0 項目jquery

這個能夠去看 Vite 的 Readme

在嘗試使用 Bootstrap
發現 npm i Bootstrap npm 不會將 Bootstrap 的內部依賴 Jquery popper.js 也一塊兒安裝
致使一連報錯git

正確方式

$ npm i bootstrap jquery popper.js

再在 main.ts 添加github

import "jquery";
import "bootstrap";
import "bootstrap/dist/css/bootstrap.min.css";

image.png

相關文章
相關標籤/搜索