fix(steps): vertical step has no separator line with no description

This commit is contained in:
07akioni 2021-02-22 10:29:39 +08:00
parent b89eb29db5
commit 04ec6b2848
4 changed files with 15 additions and 3 deletions

View File

@ -11,6 +11,7 @@
title="Let It Be"
description="When I find myself in times of trouble Mother Mary comes to me"
/>
<n-step title="Break" />
<n-step
title="Come Together"
description="Here come old flat top He come grooving up slowly"

View File

@ -11,6 +11,7 @@
title="Let It Be"
description="When I find myself in times of trouble Mother Mary comes to me"
/>
<n-step title="Break" />
<n-step
title="Come Together"
description="Here come old flat top He come grooving up slowly"

View File

@ -107,8 +107,13 @@ export default defineComponent({
}
},
render () {
const showDescription =
this.description !== undefined || this.$slots.default
return (
<div class="n-step" style={this.cssVars as CSSProperties}>
<div
class={['n-step', { 'n-step--show-description': showDescription }]}
style={this.cssVars as CSSProperties}
>
<div class="n-step-indicator">
<div class="n-step-indicator-slot">
<NIconSwitchTransition>
@ -141,7 +146,7 @@ export default defineComponent({
<div class="n-step-content-header__title">{this.title}</div>
{!this.vertical ? <div class="n-step-splitor" /> : null}
</div>
{this.description !== undefined || this.$slots.default ? (
{showDescription ? (
<div class="n-step-content__description">
{renderSlot(this.$slots, 'default', undefined, () => [
this.description

View File

@ -1,4 +1,4 @@
import { c, cB, cE, cM } from '../../../_utils/cssr'
import { c, cB, cE, cM, cNotM } from '../../../_utils/cssr'
import iconSwitchTransition from '../../../_styles/transitions/icon-switch'
// vars:
@ -117,6 +117,11 @@ export default cB('steps', `
cM('vertical', {
flexDirection: 'column'
}, [
cNotM('show-description', [
cB('step', {
paddingBottom: '8px'
})
]),
cB('step', {
marginBottom: '16px'
}, [