Skip to content

Commit

Permalink
chore: resolve Conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Wesley-0808 committed Feb 10, 2025
1 parent 0e92df8 commit 3636018
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
12 changes: 6 additions & 6 deletions packages/components/dialog/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ export default defineComponent({
const dialogEle = ref<HTMLElement | null>(null);
const dialogCardRef = ref<HTMLElement | null>(null);
const { globalConfig } = useConfig('dialog');
// header 值为 true 显示空白头部
const header = renderTNodeJSX('header', <h5 class="title"></h5>);
const body = renderContent('default', 'body');
const confirmBtnAction = (context: { e: MouseEvent }) => {
props.onConfirm?.(context);
};
Expand Down Expand Up @@ -289,8 +286,11 @@ export default defineComponent({
return !!eventFuncs?.length;
};
const renderDialog = () => {
// header 值为 true 显示空白头部
const headerContent = renderTNodeJSX('header', <h5 class="title"></h5>) ?? false;
const bodyContent = renderContent('default', 'body');
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { dialogClassName, theme, onConfirm, onCancel, onCloseBtnClick, ...otherProps } = props;
const { body, header, dialogClassName, theme, onConfirm, onCancel, onCloseBtnClick, ...otherProps } = props;
return (
// /* 非模态形态下draggable为true才允许拖拽 */
<div class={wrapClass.value}>
Expand All @@ -312,8 +312,8 @@ export default defineComponent({
ref={dialogCardRef}
theme={theme}
{...otherProps}
header={header}
body={body}
header={headerContent}
body={bodyContent}
class={dialogClassName}
onConfirm={confirmBtnAction}
onCancel={cancelBtnAction}
Expand Down
23 changes: 10 additions & 13 deletions packages/components/dialog/dialogCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default defineComponent({
CheckCircleFilledIcon: TdCheckCircleFilledIcon,
ErrorCircleFilledIcon: TdErrorCircleFilledIcon,
});
const { header, body, footer, cancelBtn, confirmBtn, confirmLoading } = toRefs(props);
const { header, body, cancelBtn, confirmBtn, confirmLoading } = toRefs(props);

const confirmBtnAction = (e: MouseEvent) => props.onConfirm?.({ e });
const cancelBtnAction = (e: MouseEvent) => props.onCancel?.({ e });
Expand Down Expand Up @@ -88,20 +88,19 @@ export default defineComponent({
return icon[props?.theme as keyof typeof icon];
};
return (
(header.value || props?.closeBtn) && (
<div class={headerClassName} onMousedown={onStopDown}>
<div class={headerClassName} onMousedown={onStopDown}>
{header.value ? (
<div class={`${COMPONENT_NAME.value}__header-content`}>
{getIcon()}
{header.value}
</div>

{props?.closeBtn ? (
<span class={closeClassName} onClick={closeBtnAction}>
{renderTNodeJSX('closeBtn', <CloseIcon />)}
</span>
) : null}
</div>
)
) : null}
{props?.closeBtn ? (
<span class={closeClassName} onClick={closeBtnAction}>
{renderTNodeJSX('closeBtn', <CloseIcon />)}
</span>
) : null}
</div>
);
};

Expand Down Expand Up @@ -131,8 +130,6 @@ export default defineComponent({
};

return {
header: header.value,
footer: footer.value,
renderHeader,
renderBody,
renderFooter,
Expand Down

0 comments on commit 3636018

Please sign in to comment.