From 2e41b3d18c40230992e5eed3db2943b61d27027b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A7=89?= Date: Thu, 16 May 2024 20:52:00 +0800 Subject: [PATCH] DEBUG radius --- main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 89a19e8..483834d 100644 --- a/main.js +++ b/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 }