Commit 88105e4b authored by 张九刚's avatar 张九刚

修改结构等同dsl

parent b9967f4b
{
"name": "psd-parse-web",
"version": "2.1.2",
"version": "2.1.3",
"main": "src/index.js",
"module": "dist/index.es.js",
"license": "MIT",
......
......@@ -60,20 +60,20 @@
console.warn(`${page.name}不合法,请保持设计稿根目录为全部文件夹形式`);
} else {
const { x, y, width, height } = page;
console.log("当前选择的mode::", mode);
//如果没有选择适配的情况下,不设置页面的属性,方便给予节点相对布局
let styleObj = mode == 'none' ? {} : { width, height, ...getPageStyle(mode, x, y) };
let viewNode = {
name: folderName,
nodeType: 'Div',
properties: {
attrs: {},
props:{
className: `${folderName}`
},
expression:{},
style: {
...styleObj
},
attrs: {
},
className: ""
}
},
uuid: generateUUID(),
children: []
......@@ -89,15 +89,18 @@
const { x, y, width, height, origin: { layer, layer: { typeTool, solidColor } } } = node;
const layout = getXYBySign(name, x, y, width, height, mode);
console.log('layout::', layout);
let properties = {
attrs: {},
props:{
className: `${name}`
},
expression:{},
style: {
width, height, ...layout
},
attrs: {
},
className: ""
}
};
let viewNode = {
......
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