UNPKG

@cataract6545/tmui

Version:

tm-vuetify是一个新势力由主题驱动的UI组件库,相比其它优势大,组件全,设计趋势紧跟未来。具有主题生成,主题实时切换,暗黑实时切换,lottie动画,图表等新颖功能,tmui TMUI

26 lines 1.06 kB
export function setDomDarkOrWhite(){ // #ifdef H5 let tmuiNavStyle= localStorage.getItem("tmuiNavStyle") let dark = localStorage.getItem('setTmVuetifyBlack'); try{ if(tmuiNavStyle&&typeof tmuiNavStyle !='undefined'){ // dark = JSON.parse(dark||'{"type":"boolean","data":false}') // let tmuiNavStyleJson = JSON.parse(tmuiNavStyle); // if(document.querySelector("#tmuiBodyId")){ // document.body.removeChild(document.querySelector("#tmuiBodyId")) // } // let style = document.createElement('style') // style.type="text/css" // style.id="tmuiBodyId"; // if(dark?.data==true||dark==true){ // style.append(document.createTextNode(`.uni-page-head{background-color:${tmuiNavStyleJson?.navbarBackground??'none'} !important} body{background:#000}`)) // }else{ // style.append(document.createTextNode(`.uni-page-head{background-color:${tmuiNavStyleJson?.navbarBackground??'none'} !important} `)) // } // document.body.append(style) } }catch(e){ //TODO handle the exception } // #endif }