mirror of https://github.com/halo-dev/halo-admin
refactor(components/modal): remove default footer button
Signed-off-by: Ryan Wang <i@ryanc.cc>pull/581/head
parent
c39e13350e
commit
a7f115f948
|
@ -1,6 +1,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { VButton } from "@/components/base/button";
|
||||
import { VModal } from "@/components/base/modal";
|
||||
import { VSpace } from "@/components/base/space";
|
||||
|
||||
function initState() {
|
||||
return {
|
||||
|
@ -26,7 +27,15 @@ function initState() {
|
|||
<img src="https://ryanc.cc/avatar" class="w-full" />
|
||||
<img src="https://halo.run/logo" class="w-full" />
|
||||
</div>
|
||||
<VButton type="secondary" @click="state.visible = false">关闭</VButton>
|
||||
|
||||
<template #footer>
|
||||
<VSpace>
|
||||
<VButton type="primary" @click="state.visible = false" loading
|
||||
>确定</VButton
|
||||
>
|
||||
<VButton @click="state.visible = false">取消</VButton>
|
||||
</VSpace>
|
||||
</template>
|
||||
</VModal>
|
||||
</template>
|
||||
<template #controls="{ state }">
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<script lang="ts" setup>
|
||||
import { VButton } from "../button";
|
||||
import { computed } from "vue";
|
||||
import { IconClose } from "@/core/icons";
|
||||
|
||||
|
@ -72,10 +71,8 @@ function handleClose() {
|
|||
<div class="modal-body">
|
||||
<slot />
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<slot name="footer">
|
||||
<VButton @click="handleClose">关闭</VButton>
|
||||
</slot>
|
||||
<div v-if="$slots.footer" class="modal-footer">
|
||||
<slot name="footer" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue