no message

Former-commit-id: 15df450e76e11e0692296a378d1465bf73aedeaf
Former-commit-id: c1aeda2883a70d55bf8ec36696b1777d1e2f420e
Former-commit-id: 2544085126872b1c5b0fd758258195ec68ca6dc2
This commit is contained in:
李杨
2018-03-10 21:13:19 +08:00
parent b01e398c31
commit 584797f714

View File

@@ -3,7 +3,7 @@
<div class="dd-card-full__header" ref="header"> <div class="dd-card-full__header" ref="header">
<slot name="header"></slot> <slot name="header"></slot>
</div> </div>
<div class="dd-card-full__body"> <div class="dd-card-full__body" :style="bodyStyle">
<slot></slot> <slot></slot>
</div> </div>
</div> </div>
@@ -34,8 +34,13 @@ export default {
default: 0 default: 0
} }
}, },
data () {
return {
headerHeight: 0
}
},
mounted () { mounted () {
console.log(this.$refs.header.offsetHeight) this.headerHeight = this.$refs.header.offsetHeight
}, },
computed: { computed: {
cardStyle () { cardStyle () {
@@ -45,6 +50,11 @@ export default {
bottom: `${this.bottom}px`, bottom: `${this.bottom}px`,
left: `${this.left}px` left: `${this.left}px`
} }
},
bodyStyle () {
return {
top: `${this.headerHeight}px`
}
} }
} }
} }
@@ -63,12 +73,19 @@ export default {
box-shadow: 0 0 8px 0 rgba(232,237,250,.6), 0 2px 4px 0 rgba(232,237,250,.5); box-shadow: 0 0 8px 0 rgba(232,237,250,.6), 0 2px 4px 0 rgba(232,237,250,.5);
} }
.dd-card-full__header { .dd-card-full__header {
position: absolute;
width: 100%;
padding: 18px 20px; padding: 18px 20px;
border-bottom: 1px solid #ebeef5; border-bottom: 1px solid #ebeef5;
box-sizing: border-box; box-sizing: border-box;
} }
.dd-card-full__body { .dd-card-full__body {
position: absolute;
padding: 20px; padding: 20px;
left: 0px;
right: 0px;
bottom: 0px;
overflow: auto;
} }
} }
</style> </style>