mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-06 12:17:13 +08:00
fix(steps): vertical step has no separator line with no description
This commit is contained in:
parent
b89eb29db5
commit
04ec6b2848
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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'
|
||||
}, [
|
||||
|
Loading…
Reference in New Issue
Block a user