(flag: boolean, clsName: string, target?: HTMLElement)
| 37 | const body = document.documentElement as HTMLElement; |
| 38 | |
| 39 | function toggleClass(flag: boolean, clsName: string, target?: HTMLElement) { |
| 40 | const targetEl = target || document.body; |
| 41 | let { className } = targetEl; |
| 42 | className = className.replace(clsName, "").trim(); |
| 43 | targetEl.className = flag ? `${className} ${clsName}` : className; |
| 44 | } |
| 45 | |
| 46 | /** 设置导航主题色 */ |
| 47 | function setLayoutThemeColor( |
no outgoing calls
no test coverage detected