hamburger icon is not showing up even if I call componentHandler.upgradeDom();

*爱你&永不变心* 提交于 2019-12-04 06:47:05

Since you are dynamically load the html, you should run the following inside your init function after the DOM is load. Notice that the setInterval function to ensure DOM has enough time to load before executing the componentHandler method

jQuery

 $(document).ready(function() {
      setInterval(function() {
           componentHandler.upgradeAllRegisteredElements();
      }, 1000);
 });

DOM API

 document.addEventListener('DOMContentLoaded', function() {
      setInterval(function() {
           componentHandler.upgradeAllRegisteredElements();
      }, 1000);
 });
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!