This commit is contained in:
Harvey Zack committed 2018-10-17 20:52:13 +08:00
1 parent 5f6febce42
commit b2159e7d4d
9 files changed
+64 -61

No files matched your search

+17
View File
@@ -29,3 +29,20 @@ export function getExt(url) {
.split('.')
.pop();
}
export function append(parent, child) {
if (child instanceof Element) {
parent.appendChild(child);
} else {
parent.innerHTML = child;
}
return parent;
}
export function setStyle(element, styles) {
Object.keys(styles).forEach(key => {
element.style[key] = styles[key];
});
return element;
}