0
你好我需要使用從Bootstrap(但正常bootstrap不React-Bootstrap)的彈出式功能,但不知何故它不適合我,我不知道爲什麼。與拉普拉普的反應popover不顯示
我正在像這樣使用它。 在我的渲染功能,我有這個按鈕
<button id="mybutton" type="button" className="btn btn-secondary" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Popover msg" data-html="true">Popover on bottom</button>
在我這裝myscript.js正確我有
> $(document).ready(function(){
> $('[data-toggle="tooltip"]').tooltip(); });
然而,當我點擊該按鈕不能正常工作。我也試過這樣
$('#mybutton').popover();
沒有成功。我有一切包括Jquery,Boostrap.js和CSS,我已經把index.html的末尾myscript.js,所以沒有任何js文件可以覆蓋其功能。
你能告訴我我做錯了什麼嗎?或者也許在React中不能使用classis反應popover? 謝謝
混合React +原生JS似乎不是一個好主意......您冒險破壞通常React應用程序的可預測狀態,並導致意想不到的效果(尤其是如果使用flux/redux)。 爲什麼不使用https://react-bootstrap.github.io/components.html#popovers(Bootstrap3)? 或https://reactstrap.github.io/components/popovers/如果您使用Bootstrap4? –