Skip to content

Commit d05c0fd

Browse files
committed
refactor:布局组件新增margin/padding样式属性
1 parent 86607a4 commit d05c0fd

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

packages/layout-page-item/src/index.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<section
33
id="t_layout_page_item"
44
class="t_layout_page_item"
5-
:class="{ 't_layout_page_item_bottm_margin': isNoBottomMargin}"
5+
:class="{ 'page_item_no_margin': isNoMargin}"
66
>
77
<slot />
88
</section>
@@ -11,7 +11,7 @@
1111
export default {
1212
name: 'TLayoutPageItem',
1313
props: {
14-
isNoBottomMargin: {
14+
isNoMargin: {
1515
type: Boolean,
1616
default: false
1717
}
@@ -20,12 +20,12 @@ export default {
2020
</script>
2121
<style lang="scss" scoped>
2222
.t_layout_page_item {
23-
// margin: 8px;
2423
padding: 16px;
2524
background: #fff;
2625
border-radius: 4px;
27-
&.t_layout_page_item_bottm_margin {
28-
margin-bottom: 0;
26+
&.page_item_no_margin {
27+
margin: 0;
28+
padding: 0;
2929
}
3030
}
3131
</style>

packages/layout-page/src/index.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<div
33
id="t_layout_page"
44
class="t_layout_page"
5+
:class="{ layout_page_no_margin: isNoMargin }"
56
ref="TLayoutPageRef"
67
@scroll="(e) => (scrollTop = e.target.scrollTop)"
78
>
@@ -18,6 +19,10 @@ export default {
1819
name: 'TLayoutPage',
1920
props: {
2021
keepScrollDisabled: Boolean,
22+
isNoMargin: {
23+
type: Boolean,
24+
default: false
25+
},
2126
// 是否显示返回顶部按钮
2227
showGoTopButton: {
2328
type: Boolean,
@@ -110,4 +115,7 @@ export default {
110115
}
111116
}
112117
}
118+
.layout_page_no_margin {
119+
padding: 0;
120+
}
113121
</style>

0 commit comments

Comments
 (0)