1.给背景色的元素统一class
操作dom式:页面初始化从localstorage取出theme,getElementsBydom得到数组遍历修改其style dom.cssText.backgroundcolor
2,vue式
定义全局theme变量存颜色 style和class动态绑定theme
3.less
window.less.modifyVars({
‘ @theme’:‘WHITE’
})
1.给背景色的元素统一class
操作dom式:页面初始化从localstorage取出theme,getElementsBydom得到数组遍历修改其style dom.cssText.backgroundcolor
2,vue式
定义全局theme变量存颜色 style和class动态绑定theme
3.less
window.less.modifyVars({
‘ @theme’:‘WHITE’
})