Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
psd-parse-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
psd-parse-web
Commits
88105e4b
Commit
88105e4b
authored
Jul 08, 2021
by
张九刚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改结构等同dsl
parent
b9967f4b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
package.json
package.json
+1
-1
compilelocal.js
src/compilelocal.js
+12
-9
No files found.
package.json
View file @
88105e4b
{
{
"name"
:
"psd-parse-web"
,
"name"
:
"psd-parse-web"
,
"version"
:
"2.1.
2
"
,
"version"
:
"2.1.
3
"
,
"main"
:
"src/index.js"
,
"main"
:
"src/index.js"
,
"module"
:
"dist/index.es.js"
,
"module"
:
"dist/index.es.js"
,
"license"
:
"
MIT
"
,
"license"
:
"
MIT
"
,
...
...
src/compilelocal.js
View file @
88105e4b
...
@@ -60,20 +60,20 @@
...
@@ -60,20 +60,20 @@
console
.
warn
(
`
${
page
.
name
}
不合法,请保持设计稿根目录为全部文件夹形式`
);
console
.
warn
(
`
${
page
.
name
}
不合法,请保持设计稿根目录为全部文件夹形式`
);
}
else
{
}
else
{
const
{
x
,
y
,
width
,
height
}
=
page
;
const
{
x
,
y
,
width
,
height
}
=
page
;
console
.
log
(
"当前选择的mode::"
,
mode
);
//如果没有选择适配的情况下,不设置页面的属性,方便给予节点相对布局
//如果没有选择适配的情况下,不设置页面的属性,方便给予节点相对布局
let
styleObj
=
mode
==
'none'
?
{}
:
{
width
,
height
,
...
getPageStyle
(
mode
,
x
,
y
)
};
let
styleObj
=
mode
==
'none'
?
{}
:
{
width
,
height
,
...
getPageStyle
(
mode
,
x
,
y
)
};
let
viewNode
=
{
let
viewNode
=
{
name
:
folderName
,
name
:
folderName
,
nodeType
:
'Div'
,
nodeType
:
'Div'
,
properties
:
{
properties
:
{
attrs
:
{},
props
:{
className
:
`
${
folderName
}
`
},
expression
:{},
style
:
{
style
:
{
...
styleObj
...
styleObj
},
}
attrs
:
{
},
className
:
""
},
},
uuid
:
generateUUID
(),
uuid
:
generateUUID
(),
children
:
[]
children
:
[]
...
@@ -89,15 +89,18 @@
...
@@ -89,15 +89,18 @@
const
{
x
,
y
,
width
,
height
,
origin
:
{
layer
,
layer
:
{
typeTool
,
solidColor
}
}
}
=
node
;
const
{
x
,
y
,
width
,
height
,
origin
:
{
layer
,
layer
:
{
typeTool
,
solidColor
}
}
}
=
node
;
const
layout
=
getXYBySign
(
name
,
x
,
y
,
width
,
height
,
mode
);
const
layout
=
getXYBySign
(
name
,
x
,
y
,
width
,
height
,
mode
);
console
.
log
(
'layout::'
,
layout
);
let
properties
=
{
let
properties
=
{
attrs
:
{},
props
:{
className
:
`
${
name
}
`
},
expression
:{},
style
:
{
style
:
{
width
,
height
,
...
layout
width
,
height
,
...
layout
},
},
attrs
:
{
attrs
:
{
},
}
className
:
""
};
};
let
viewNode
=
{
let
viewNode
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment