mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-03 20:47:56 +08:00
fix(modal): title props support render function (#3031)
This commit is contained in:
parent
157d0e72e9
commit
9ac18c5e52
@ -82,7 +82,9 @@ const ConfirmDialog = (_, { attrs }) => {
|
||||
<div class={`${contentPrefixCls}-body`}>
|
||||
{typeof icon === 'function' ? icon() : icon}
|
||||
{attrs.title === undefined ? null : (
|
||||
<span class={`${contentPrefixCls}-title`}>{attrs.title}</span>
|
||||
<span class={`${contentPrefixCls}-title`}>
|
||||
{typeof attrs.title === 'function' ? attrs.title() : attrs.title}
|
||||
</span>
|
||||
)}
|
||||
<div class={`${contentPrefixCls}-content`}>
|
||||
{typeof attrs.content === 'function' ? attrs.content() : attrs.content}
|
||||
|
@ -102,4 +102,12 @@ describe('Modal.confirm triggers callbacks correctly', () => {
|
||||
expect($$(`.ant-modal-confirm-${type}`)).toHaveLength(0);
|
||||
}
|
||||
});
|
||||
|
||||
it('should render title', async () => {
|
||||
open({
|
||||
title: h => <span>title</span>,
|
||||
});
|
||||
await sleep();
|
||||
expect($$('.ant-modal-confirm-title')[0].innerHTML).toBe('<span>title</span>');
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user