refactor: ♻️ 优化主题和主题色集中监听,避免多处初始化
This commit is contained in:
@@ -30,6 +30,8 @@ export function removeClass(ele: HTMLElement, cls: string) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是外部链接
|
||||
*
|
||||
* @param {string} path
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
@@ -37,3 +39,13 @@ export function isExternal(path: string) {
|
||||
const isExternal = /^(https?:|http?:|mailto:|tel:)/.test(path);
|
||||
return isExternal;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置Style属性
|
||||
*
|
||||
* @param propName
|
||||
* @param value
|
||||
*/
|
||||
export function setStyleProperty(propName: string, value: string) {
|
||||
document.documentElement.style.setProperty(propName, value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user