import AvatarCircle from '@/user/AvatarCircle' import useRouterStore from '@/useRouterStore' import asyncLoader from '@/utils/asyncLoader' import { computed, defineComponent, Transition } from 'vue' const Content = asyncLoader(() => import('./SettingsOverlayContent')) const SettingsTab = defineComponent({ props: { label: { type: String, required: true }, path: { type: String, required: true } }, setup(props) { const router = useRouterStore() return () => (
{ router.go(props.path as any) }} > {props.label}
) } }) export default defineComponent(() => { const router = useRouterStore() const show = computed(() => router.path.startsWith('settings-')) return () => (
{/* 背景遮罩 */} {show.value && (
{ router.back() }} >
)} {/* 弹框主体 */} {show.value && (
{ router.go('settings-user') }} >
)}
) })