简体   繁体   English

正常的 Bootstrap 弹出框和 Angular 应用程序在一页中 - 弹出框不起作用

[英]Normal Bootstrap Popover and Angular app in one page - Popover not working

I have a webproject where I server side rendering with a bootstrap theme and jquery.我有一个网络项目,我在其中使用引导主题和 jquery 进行服务器端渲染。 So far everything works fine, except that the dropdown of a nav element is not working anymore.到目前为止,一切正常,除了导航元素的下拉列表不再起作用。 When clicking the dropdown element, the following error is thrown:单击下拉元素时,会引发以下错误:

Uncaught Error: DROPDOWN: Option "popperConfig" provided type "window" but expected type "(null|object)".  
        at Object.typeCheckConfig (bootstrap.min.js:6)  
        at c.t._getConfig (bootstrap.min.js:6)  
        at new c (bootstrap.min.js:6)  
        at HTMLDivElement.<anonymous> (bootstrap.min.js:6)  
        at Function.each (jquery.min.js:2)  
        at k.fn.init.each (jquery.min.js:2)  
        at k.fn.init.c._jQueryInterface [as dropdown] (bootstrap.min.js:6)  
        at HTMLDivElement.<anonymous> (bootstrap.min.js:6)  
        at HTMLDocument.dispatch (jquery.min.js:2)  
        at HTMLDocument.v.handle (jquery.min.js:2) typeCheckConfig @  bootstrap.min.js:6 t._getConfig @ bootstrap.min.js:6 c @ bootstrap.min.js:6 (anonymous) @ bootstrap.min.js:6 each @ jquery.min.js:2 each @ jquery.min.js:2  c._jQueryInterface @ bootstrap.min.js:6 (anonymous) @ bootstrap.min.js:6 dispatch @ jquery.min.js:2 v.handle @ jquery.min.js:2

This is only happening when the AngularApp is included in the page.仅当页面中包含 AngularApp 时才会发生这种情况。 Without it works without any issues.没有它可以正常工作。

Bootstrap 4, JQuery 3.4.1, Angular 11.2.引导程序 4,JQuery 3.4.1,Angular 11.2。

Jquery is not included in the angular build but loaded within the page where the angular app is included. Jquery 不包含在 angular 构建中,但在包含 angular 应用程序的页面中加载。

From: https://stackoverflow.com/a/59633070/1772933来自: https://stackoverflow.com/a/59633070/1772933

Apparently this is a known issue with bootstrap 4.4+ version.显然这是 bootstrap 4.4+ 版本的一个已知问题。 If that fits your scenario, try upgrading to 4.5 ( https://github.com/twbs/bootstrap/pull/30383 )如果这适合您的情况,请尝试升级到 4.5 ( https://github.com/twbs/bootstrap/pull/30383 )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM