f1d2a405f9
- 个人中心重设计:对齐站点黑白编辑风(极简资料区+细分隔线统计、下划线页签、 细边框卡片、克制危险区、收藏网格、评论列表),移除后台系组件与彩色渐变 - 后台响应式适配:表格页 md 以下卡片堆叠(md:hidden/hidden md:block 双模板)、 Dashboard 统计卡自适应、表单双语两列、AdminModal 移动端底部弹层、 触摸目标与间距统一,覆盖全部 9 个后台页 + 布局
56 lines
1.7 KiB
Vue
56 lines
1.7 KiB
Vue
<template>
|
||
<Teleport to="body">
|
||
<Transition name="modal">
|
||
<div
|
||
v-if="open"
|
||
class="fixed inset-0 z-[150] flex items-end justify-center bg-black/40 p-0 sm:items-center sm:p-4"
|
||
@click.self="emit('update:open', false)"
|
||
>
|
||
<!-- 移动端底部弹层;≥sm 居中 -->
|
||
<div class="w-full max-w-lg rounded-t-2xl bg-white shadow-2xl sm:rounded-2xl sm:max-h-[85vh] sm:flex sm:flex-col max-h-[92vh] flex flex-col">
|
||
<div class="flex items-center justify-between border-b border-gray-100 px-6 py-4">
|
||
<h3 class="text-lg font-bold text-black">{{ title }}</h3>
|
||
<button @click="emit('update:open', false)" class="text-gray-400 hover:text-gray-600" aria-label="close">
|
||
<Icon name="ph:x" class="w-5 h-5" />
|
||
</button>
|
||
</div>
|
||
<div class="px-6 py-5 overflow-y-auto min-h-0"><slot /></div>
|
||
<div v-if="$slots.footer" class="flex justify-end gap-2 border-t border-gray-100 px-6 py-4">
|
||
<slot name="footer" />
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</Transition>
|
||
</Teleport>
|
||
</template>
|
||
|
||
<script setup lang="ts">
|
||
withDefaults(defineProps<{ open: boolean; title?: string }>(), { title: '' })
|
||
const emit = defineEmits<{ 'update:open': [v: boolean] }>()
|
||
</script>
|
||
|
||
<style scoped>
|
||
.modal-enter-active,
|
||
.modal-leave-active {
|
||
transition: opacity 0.22s ease;
|
||
}
|
||
.modal-enter-from,
|
||
.modal-leave-to {
|
||
opacity: 0;
|
||
}
|
||
.modal-enter-active > div,
|
||
.modal-leave-active > div {
|
||
transition: transform 0.28s ease;
|
||
}
|
||
.modal-enter-from > div,
|
||
.modal-leave-to > div {
|
||
transform: translateY(24px);
|
||
}
|
||
@media (min-width: 640px) {
|
||
.modal-enter-from > div,
|
||
.modal-leave-to > div {
|
||
transform: scale(0.97) translateY(8px);
|
||
}
|
||
}
|
||
</style>
|