Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quantum-blocks
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
quantum-blocks
Commits
8f38572b
Commit
8f38572b
authored
Aug 26, 2021
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 处理高度和内间距的关系
parent
db7ff7cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
index.ts
app/web/page/editor/component/DynamicForm/index.ts
+3
-2
contextMenu.mixin.ts
app/web/page/editor/mixins/contextMenu.mixin.ts
+4
-2
No files found.
app/web/page/editor/component/DynamicForm/index.ts
View file @
8f38572b
...
...
@@ -335,10 +335,11 @@ export default class DynamicForm extends Mixins(ContextMenuMixin, DynamicFormMix
}
changeMargin
()
{
const
ele
=
this
.
getCurElement
();
const
prevCommonStyle
=
cloneDeep
(
ele
.
commonStyle
||
{});
// this.point.w = this.point.w - (this.commonStyle.paddingLeft || 0) - (this.commonStyle.paddingRight || 0);
this
.
point
.
h
=
this
.
point
.
h
-
(
this
.
prevCommonStyle
.
paddingTop
||
0
)
-
(
this
.
prevCommonStyle
.
paddingBottom
||
0
)
+
(
this
.
commonStyle
.
paddingTop
||
0
)
+
(
this
.
commonStyle
.
paddingBottom
||
0
);
this
.
point
.
h
=
this
.
point
.
h
-
(
prevCommonStyle
.
paddingTop
||
0
)
-
(
prevCommonStyle
.
paddingBottom
||
0
)
+
(
this
.
commonStyle
.
paddingTop
||
0
)
+
(
this
.
commonStyle
.
paddingBottom
||
0
);
this
.
updateCommonStyle
({
containerIndex
:
this
.
curEleIndex
,
childIndex
:
this
.
curChildIndex
,
data
:
this
.
commonStyle
});
this
.
prevCommonStyle
=
cloneDeep
(
this
.
commonStyle
);
this
.
updatePoint
();
// this.adjustHeight();
}
...
...
app/web/page/editor/mixins/contextMenu.mixin.ts
View file @
8f38572b
...
...
@@ -37,7 +37,9 @@ export default class ContextMenuMixin extends Vue {
const
elements
=
this
.
pageData
.
elements
[
this
.
curEleIndex
];
const
component
=
document
.
getElementById
(
elements
.
id
);
const
height
=
component
?
getStyle
(
component
,
'
height
'
)
:
0
;
console
.
log
(
'
adjustHeight
'
,
height
);
this
.
updatePageInfo
({
containerIndex
:
this
.
curEleIndex
,
data
:
{
...
elements
,
point
:
{
...
elements
.
point
,
h
:
Math
.
ceil
(
+
height
||
elements
.
point
.
h
)
}
}
});
const
paddingTop
=
elements
.
commonStyle
.
paddingTop
||
0
;
const
paddingBottom
=
elements
.
commonStyle
.
paddingBottom
||
0
;
console
.
log
(
'
adjustHeight
'
,
height
,
elements
.
commonStyle
);
this
.
updatePageInfo
({
containerIndex
:
this
.
curEleIndex
,
data
:
{
...
elements
,
point
:
{
...
elements
.
point
,
h
:
Math
.
ceil
((
+
height
||
elements
.
point
.
h
)
+
paddingTop
+
paddingBottom
)
}
}
});
}
}
\ No newline at end of file
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