layui/.svn/pristine/4c/4c7578ad69570748a3c09ce0c1a50448211d2393.svn-base
2022-12-09 16:41:41 +08:00

11 lines
385 B
Plaintext

function indentHandle(obj) {
const { indent, level, basePadding = 0, isTree } = obj;
const least = level - 1;
if (isTree && indent && least > 0) {
const px = typeof indent === "boolean" ? `${basePadding + 10 * least}px` : indent.replace(/\d+/g, (s) => (basePadding + least * +s).toString());
return `padding-left: ${px}`;
}
return "";
}
export { indentHandle as i };