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>
|
<script lang="ts" setup>
|
||||||
import { VButton } from "@/components/base/button";
|
import { VButton } from "@/components/base/button";
|
||||||
import { VModal } from "@/components/base/modal";
|
import { VModal } from "@/components/base/modal";
|
||||||
|
import { VSpace } from "@/components/base/space";
|
||||||
|
|
||||||
function initState() {
|
function initState() {
|
||||||
return {
|
return {
|
||||||
|
@ -26,7 +27,15 @@ function initState() {
|
||||||
<img src="https://ryanc.cc/avatar" class="w-full" />
|
<img src="https://ryanc.cc/avatar" class="w-full" />
|
||||||
<img src="https://halo.run/logo" class="w-full" />
|
<img src="https://halo.run/logo" class="w-full" />
|
||||||
</div>
|
</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>
|
</VModal>
|
||||||
</template>
|
</template>
|
||||||
<template #controls="{ state }">
|
<template #controls="{ state }">
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { VButton } from "../button";
|
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
import { IconClose } from "@/core/icons";
|
import { IconClose } from "@/core/icons";
|
||||||
|
|
||||||
|
@ -72,10 +71,8 @@ function handleClose() {
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div v-if="$slots.footer" class="modal-footer">
|
||||||
<slot name="footer">
|
<slot name="footer" />
|
||||||
<VButton @click="handleClose">关闭</VButton>
|
|
||||||
</slot>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue