diff --git a/packages/fighting-design/_hooks/use-confirm-box/index.ts b/packages/fighting-design/_hooks/use-confirm-box/index.ts index dc8e151a0a..88e2b6b310 100644 --- a/packages/fighting-design/_hooks/use-confirm-box/index.ts +++ b/packages/fighting-design/_hooks/use-confirm-box/index.ts @@ -11,7 +11,6 @@ export const useConfirmBox = (component: Component) => { render(vNode, container) - document.body.appendChild(container.firstElementChild as HTMLElement) return vNode.component as ComponentInternalInstance } diff --git a/packages/fighting-design/confirm-box/src/confirm-box.vue b/packages/fighting-design/confirm-box/src/confirm-box.vue index 6ea0e0eb4f..dbffe4ef5c 100644 --- a/packages/fighting-design/confirm-box/src/confirm-box.vue +++ b/packages/fighting-design/confirm-box/src/confirm-box.vue @@ -4,11 +4,14 @@ import { FSpace } from '../../space' import { FCloseBtn } from '../../close-btn' import { ref } from 'vue' + import { useRun } from '../../_hooks' defineOptions({ name: 'FConfirmBox' }) const prop = defineProps(Props) + const { run } = useRun() + /** 是否展示确认框 */ const isShow = ref(prop.show) @@ -16,34 +19,51 @@ const handelClose = (): void => { isShow.value = false } + + /** 开启之后执行的回调方法 */ + const handleOpenEnd = (): void => { + run(prop.onOpen, isShow.value) + } + + /** 关闭之后执行的回调方法 */ + const handleCloseEnd = (): void => { + run(prop.onClose, isShow.value) + } diff --git a/packages/fighting-design/confirm-box/src/props.ts b/packages/fighting-design/confirm-box/src/props.ts index fc15a60cfd..1b65be22f3 100644 --- a/packages/fighting-design/confirm-box/src/props.ts +++ b/packages/fighting-design/confirm-box/src/props.ts @@ -4,7 +4,7 @@ import type { HandleMouse, HandleChange } from '../../_interface' export const Props = { /** 是否展示 */ - show: setBooleanProp(), + show: setBooleanProp(false), /** 标题内容 */ title: setStringProp(), /** 提示内容 */ diff --git a/packages/fighting-theme/src/confirm-box.scss b/packages/fighting-theme/src/confirm-box.scss index ab87bd2c76..3225d6c75c 100644 --- a/packages/fighting-theme/src/confirm-box.scss +++ b/packages/fighting-theme/src/confirm-box.scss @@ -50,7 +50,7 @@ // 身体 .f-confirm-box__body { margin-top: 24px; - margin-bottom: 15px; + margin-bottom: 18px; font-size: 15px; color: #333; } @@ -61,17 +61,16 @@ align-items: center; justify-content: flex-end; } + } - // // 主内容动画样式 - // &-trans-enter-active, - // &-trans-leave-active { - // transition: all 0.2s ease-out; - // } + &__trans-enter-active, + &__trans-leave-active { + transition: all 0.2s ease-out; + } - // &-trans-enter-from, - // &-trans-leave-to { - // transform: scale(0.4); - // opacity: 0; - // } + &__trans-enter-from, + &__trans-leave-to { + transform: scale(1.1); + opacity: 0; } } diff --git a/start/index.html b/start/index.html index cb5ddf03bd..9a89615f1f 100644 --- a/start/index.html +++ b/start/index.html @@ -2,10 +2,6 @@ - fighting-design/start diff --git a/start/src/App.vue b/start/src/App.vue index b015ff1b23..36062afb3e 100644 --- a/start/src/App.vue +++ b/start/src/App.vue @@ -1,7 +1,13 @@