init
This commit is contained in:
10
es/utils/index.js
Normal file
10
es/utils/index.js
Normal file
@@ -0,0 +1,10 @@
|
||||
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 };
|
||||
Reference in New Issue
Block a user