DEBUG radius

This commit is contained in:
2024-05-16 20:52:00 +08:00
parent b6df98b35d
commit 2e41b3d18c

View File

@ -13,6 +13,7 @@ export function createElement({ innerText, innerHTML, textContent, readOnly, chi
if (readOnly) element.readOnly = readOnly
if (children) children.forEach(child => element.appendChild(child))
// 为元素添加链式操作方法
element.w = (width) => { element.style.width = width; return element }
element.h = (height) => { element.style.height = height; return element }
element.text = (text) => { element.textContent = text; return element }
@ -21,7 +22,7 @@ export function createElement({ innerText, innerHTML, textContent, readOnly, chi
element.bg = (color) => { element.style.backgroundColor = color; return element }
element.grid = (options) => { element.style.display = 'grid'; Object.assign(element.style, options); return element }
element.flex = (options) => { element.style.display = 'flex'; Object.assign(element.style, options); return element }
element.borderRadius = (radius) => { element.style.borderRadius = radius; return element }
element.radius = (radius) => { element.style.borderRadius = radius; return element }
element.p = (padding) => applyStyle(element, 'padding', padding)
element.m = (margin) => applyStyle(element, 'margin', margin)
element.mx = (value) => { element.style.marginLeft = value; element.style.marginRight = value; return element }