fix(step): fix steps doesn't work with v-for children (#1119)

Co-authored-by: 07akioni <07akioni2@gmail.com>
This commit is contained in:
XieZongChen 2021-09-07 12:22:00 -05:00 committed by GitHub
parent 6f985e810c
commit 0a4872df9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -2,6 +2,10 @@
## Pending
### Fixes
- Fix `n-step` doesn't work with `v-for` children.
### Feats
- `useDialog` option add `style` prop, closes [#1054](https://github.com/TuSimple/naive-ui/issues/1054).

View File

@ -2,6 +2,10 @@
## Pending
### Fixes
- 修复 `n-step` 无法使用 `v-for` 的子元素
### Feats
- `useDialog` 选项新增 `style` 属性,关闭 [#1054](https://github.com/TuSimple/naive-ui/issues/1054)

View File

@ -14,7 +14,7 @@ import type { MergedTheme, ThemeProps } from '../../_mixins'
import { useConfig, useTheme } from '../../_mixins'
import { stepsLight } from '../styles'
import style from './styles/index.cssr'
import { ExtractPublicPropTypes, getSlot } from '../../_utils'
import { ExtractPublicPropTypes, flatten, getSlot } from '../../_utils'
import type { StepsTheme } from '../styles'
function stepWithIndex (step: VNodeChild, i: number): VNode | null {
@ -87,7 +87,7 @@ export default defineComponent({
this.vertical && `${mergedClsPrefix}-steps--vertical`
]}
>
{stepsWithIndex(getSlot(this))}
{stepsWithIndex(flatten(getSlot(this)))}
</div>
)
}