Commit d40fce2e authored by rockyl's avatar rockyl

导出宽高

parent 824f78d2
......@@ -12,7 +12,7 @@ const styleKeys = [
]
export function parseDom(el: HTMLElement) {
const {left: pX, top: pY} = el.getBoundingClientRect();
const {left: pX, top: pY, width, height} = el.getBoundingClientRect();
let nodes = [];
walkNode(el, function (childNode) {
......@@ -58,7 +58,11 @@ export function parseDom(el: HTMLElement) {
nodes.push(vNode);
}
});
return nodes;
return {
width,
height,
nodes,
};
}
function walkNode(root, callback) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment