Unverified Commit 7eb35815 by Sendya

fix: DetailList empty item height no-out #109

parent 31b018e7
...@@ -25,6 +25,7 @@ const Item = { ...@@ -25,6 +25,7 @@ const Item = {
} }
}, },
render () { render () {
console.log('this.$slots.default', this.$slots.default)
return ( return (
<Col {...{ props: responsive[this.col] }}> <Col {...{ props: responsive[this.col] }}>
<div class="term">{this.$props.term}</div> <div class="term">{this.$props.term}</div>
...@@ -77,7 +78,7 @@ export default { ...@@ -77,7 +78,7 @@ export default {
} }
</script> </script>
<style lang="less"> <style lang="less" scoped>
.detail-list { .detail-list {
...@@ -88,7 +89,7 @@ export default { ...@@ -88,7 +89,7 @@ export default {
margin-bottom: 16px; margin-bottom: 16px;
} }
.term { /deep/ .term {
color: rgba(0,0,0,.85); color: rgba(0,0,0,.85);
display: table-cell; display: table-cell;
line-height: 20px; line-height: 20px;
...@@ -96,7 +97,7 @@ export default { ...@@ -96,7 +97,7 @@ export default {
padding-bottom: 16px; padding-bottom: 16px;
white-space: nowrap; white-space: nowrap;
&:after { &:not(:empty):after {
content: ":"; content: ":";
margin: 0 8px 0 2px; margin: 0 8px 0 2px;
position: relative; position: relative;
...@@ -104,12 +105,18 @@ export default { ...@@ -104,12 +105,18 @@ export default {
} }
} }
.content { /deep/ .content {
color: rgba(0,0,0,.65); color: rgba(0,0,0,.65);
display: table-cell; display: table-cell;
min-height: 22px;
line-height: 22px; line-height: 22px;
padding-bottom: 16px; padding-bottom: 16px;
width: 100%; width: 100%;
&:empty {
content: ' ';
height: 38px;
padding-bottom: 16px;
}
} }
&.small { &.small {
...@@ -120,13 +127,13 @@ export default { ...@@ -120,13 +127,13 @@ export default {
font-weight: normal; font-weight: normal;
margin-bottom: 12px; margin-bottom: 12px;
} }
.term, .content { /deep/ .term, .content {
padding-bottom: 8px; padding-bottom: 8px;
} }
} }
&.large { &.large {
.term, .content { /deep/ .term, .content {
padding-bottom: 16px; padding-bottom: 16px;
} }
...@@ -139,9 +146,9 @@ export default { ...@@ -139,9 +146,9 @@ export default {
.term { .term {
padding-bottom: 8px; padding-bottom: 8px;
} }
.term, .content { /deep/ .term, .content {
display: block; display: block;
} }
} }
} }
</style> </style>
...@@ -53,10 +53,10 @@ ...@@ -53,10 +53,10 @@
<detail-list title="信息组"> <detail-list title="信息组">
<detail-list-item term="某某数据">725</detail-list-item> <detail-list-item term="某某数据">725</detail-list-item>
<detail-list-item term="该数据更新时间">2018-08-08</detail-list-item> <detail-list-item term="该数据更新时间">2018-08-08</detail-list-item>
<detail-list-item >&nbsp;</detail-list-item> <detail-list-item ></detail-list-item>
<detail-list-item term="某某数据">725</detail-list-item> <detail-list-item term="某某数据">725</detail-list-item>
<detail-list-item term="该数据更新时间">2018-08-08</detail-list-item> <detail-list-item term="该数据更新时间">2018-08-08</detail-list-item>
<detail-list-item >&nbsp;</detail-list-item> <detail-list-item ></detail-list-item>
</detail-list> </detail-list>
<a-card type="inner" title="多层信息组"> <a-card type="inner" title="多层信息组">
<detail-list title="组名称" size="small"> <detail-list title="组名称" size="small">
...@@ -339,4 +339,4 @@ export default { ...@@ -339,4 +339,4 @@ export default {
text-align: left; text-align: left;
} }
} }
</style> </style>
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