我有一个 main.js 文件,我在其中导入 bootstrap,但为了清楚起见,我将自己的 bootstrap.js 导入到真正的 bootstrap 导入位置。然后我想在 main.js 中使用 bootstrap scolSpy 但不起作用。
main.js
import './bootstrap.js';
var scrollSpy = new ScrollSpy(document.body, {
target: '#menu'
})
...
引导程序.js
import { ScrollSpy } from 'bootstrap';
它给了我一个在 main.js 中没有定义 ScrollSpy 的错误
那么我如何在 main.js 中使用 ScrollSpy 呢?
谢谢!