mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
fix(timeline): fix NTimeline header slot (#706)
Co-authored-by: 07akioni <07akioni2@gmail.com>
This commit is contained in:
parent
b019866aa3
commit
3bd2379ef7
@ -7,6 +7,7 @@
|
||||
### Fixes
|
||||
|
||||
- Fix `n-message`'s `destroyAll` method doesn't work.
|
||||
- Fix `n-timeline`'s header slot is invalid when using alone.
|
||||
|
||||
## 2.15.9 (2021-07-28)
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
### Fixes
|
||||
|
||||
- 修复 `n-message` 的 `destroyAll` 方法不生效
|
||||
- 修复 `n-timeline` 的 header slot 单独使用无效的问题
|
||||
|
||||
## 2.15.9 (2021-07-28)
|
||||
|
||||
|
@ -88,7 +88,7 @@ export default defineComponent({
|
||||
<div class={`${mergedClsPrefix}-timeline-item-timeline__circle`} />
|
||||
</div>
|
||||
<div class={`${mergedClsPrefix}-timeline-item-content`}>
|
||||
{this.title ? (
|
||||
{this.title || this.$slots.header ? (
|
||||
<div class={`${mergedClsPrefix}-timeline-item-content__title`}>
|
||||
{renderSlot(this.$slots, 'header', undefined, () => [this.title])}
|
||||
</div>
|
||||
|
@ -90,12 +90,16 @@ describe('n-timeline-item', () => {
|
||||
slots: {
|
||||
default: () =>
|
||||
h(NTimelineItem, null, {
|
||||
default: () => 'test-default',
|
||||
header: () => 'test-header',
|
||||
default: () => 'test-default',
|
||||
footer: () => 'test-footer'
|
||||
})
|
||||
}
|
||||
})
|
||||
expect(wrapper.find('.n-timeline-item-content__title').exists()).toBe(true)
|
||||
expect(wrapper.find('.n-timeline-item-content__title').text()).toBe(
|
||||
'test-header'
|
||||
)
|
||||
expect(wrapper.find('.n-timeline-item-content__content').exists()).toBe(
|
||||
true
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user