1 Star 2 Fork 0

tommyrunner/vue-share-element

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
uitls.ts 573 Bytes
一键复制 编辑 原始数据 按行查看 历史
tommyrunner 提交于 2023-07-10 18:04 +08:00 . feat: 优化utils,批量修改样式
type ElementStyle = {
position?: string;
zIndex?: number;
top?: string;
left?: string;
width?: string;
height?: string;
overflow?: string;
margin?: string;
opacity?: number;
transition?: string;
};
/**
* Set style in batch
* @param element
* @param style
*/
export function setElementStyle(element: HTMLElement | null, style: ElementStyle) {
let temStyle: { [key in string]: string | number } = {};
Object.entries(style).forEach((s) => {
temStyle[s[0]] = s[1];
});
if (element && element.style) Object.assign(element.style, temStyle);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tommyrunner/vue-share-element.git
git@gitee.com:tommyrunner/vue-share-element.git
tommyrunner
vue-share-element
vue-share-element
master

搜索帮助