fix(steps): transition not disabled when mounted

This commit is contained in:
07akioni 2020-02-29 21:32:55 +08:00
parent 2ffe26881a
commit 29d135faee
3 changed files with 28 additions and 4 deletions

View File

@ -43,13 +43,24 @@ export default {
default: false
}
},
data () {
return {
transitionDisabled: true
}
},
mounted () {
this.$nextTick().then(() => {
this.transitionDisabled = false
})
},
render (h) {
return h('div', {
staticClass: 'n-steps',
class: {
[`n-${this.syntheticTheme}-theme`]: this.syntheticTheme,
[`n-steps--${this.size}-size`]: true,
'n-steps--vertical': this.vertical
'n-steps--vertical': this.vertical,
'n-steps--transition-disabled': this.transitionDisabled
}
}, stepsWithIndex({ ...this.$props }, this.$slots.default))
}

View File

@ -134,7 +134,7 @@
}
@include m(transition-disabled) {
@include b(radio-button) {
transition: none;
transition: none !important;
}
}
height: 28px;

View File

@ -80,7 +80,9 @@
width: 100%;
display: flex;
@include b(step-splitor) {
transition: color .3s $--n-ease-in-out-cubic-bezier, background-color .3s $--n-ease-in-out-cubic-bezier;
transition:
color .3s $--n-ease-in-out-cubic-bezier,
background-color .3s $--n-ease-in-out-cubic-bezier;
height: 1px;
flex: 1;
align-self: flex-start;
@ -107,7 +109,9 @@
}
}
@include b(step-indicator) {
transition: background-color .3s $--n-ease-in-out-cubic-bezier, box-shadow .3s $--n-ease-in-out-cubic-bezier;
transition:
background-color .3s $--n-ease-in-out-cubic-bezier,
box-shadow .3s $--n-ease-in-out-cubic-bezier;
display: flex;
align-items: center;
justify-content: center;
@ -128,6 +132,15 @@
}
}
}
@include m(transition-disabled) {
@include b(step-indicator) {
@include b(step-indicator-slot) {
@include e(index) {
transition: none !important;
}
}
}
}
@include m(vertical) {
flex-direction: column;
$step-margin-bottom: 16px;