優(yōu)化一下:當菜單未關閉時點擊×,先關閉菜單再關閉側邊欄。
//只需要在Sidebar的關閉函數(shù)里寫:
if(this.menubar.state?===?"hasOpen"){???????? ????this.menubar.currentOpenTarget.className?=?'nav-content'; ????this.menubar.currentOpenTarget.style.top?=?0; ????this.menubar.currentOpenTarget.style.left?=?35?+?'px'; ????this.menubar.currentOpenTarget.classList.add('menuContent-move-left'); ????this.menubar.state?=?'allClose'; }
2018-12-27
附上一張圖