DEBUG radius
This commit is contained in:
parent
b6df98b35d
commit
2e41b3d18c
3
main.js
3
main.js
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user