style: 菜单背景支持跟随暗黑模式

This commit is contained in:
kailong321200875
2023-12-26 14:53:20 +08:00
parent 49a1f54c9f
commit b34aeba10a
4 changed files with 28 additions and 16 deletions

View File

@@ -45,6 +45,10 @@ export const setCssVar = (prop: string, val: any, dom = document.documentElement
dom.style.setProperty(prop, val)
}
export const getCssVar = (prop: string, dom = document.documentElement) => {
return getComputedStyle(dom).getPropertyValue(prop)
}
/**
* 查找数组对象的某个下标
* @param {Array} ary 查找的数组