From 4f709aaf98feaeff89181feb47e644b7bb71e6de Mon Sep 17 00:00:00 2001 From: Aggre Date: Fri, 25 Oct 2024 00:42:24 +0900 Subject: [PATCH] modal impl --- src/pages/passport/components/ImageCard.vue | 2 +- src/pages/passport/components/Modal.vue | 97 +++++++++++++++++++ .../passport/components/PassportClip.vue | 22 ++++- .../passport/components/PassportClips.vue | 37 ++++++- 4 files changed, 151 insertions(+), 7 deletions(-) create mode 100644 src/pages/passport/components/Modal.vue diff --git a/src/pages/passport/components/ImageCard.vue b/src/pages/passport/components/ImageCard.vue index 480d464b9..82d3c9d4d 100644 --- a/src/pages/passport/components/ImageCard.vue +++ b/src/pages/passport/components/ImageCard.vue @@ -37,7 +37,7 @@ onMounted(async () => { diff --git a/src/pages/passport/components/Modal.vue b/src/pages/passport/components/Modal.vue new file mode 100644 index 000000000..2dd4de179 --- /dev/null +++ b/src/pages/passport/components/Modal.vue @@ -0,0 +1,97 @@ + + + + + diff --git a/src/pages/passport/components/PassportClip.vue b/src/pages/passport/components/PassportClip.vue index 7925741db..5e48e5724 100644 --- a/src/pages/passport/components/PassportClip.vue +++ b/src/pages/passport/components/PassportClip.vue @@ -13,6 +13,8 @@ import type { ImageData, PassportClip } from '../types' const props = defineProps<{ item: PassportClip + truncate?: boolean + classes?: string }>() const clubConfig = ref() @@ -54,7 +56,11 @@ onMounted(async () => { + + diff --git a/src/pages/passport/components/PassportClips.vue b/src/pages/passport/components/PassportClips.vue index 1733c49f8..5e3dd59d6 100644 --- a/src/pages/passport/components/PassportClips.vue +++ b/src/pages/passport/components/PassportClips.vue @@ -6,13 +6,23 @@ import { Strings } from '../i18n' import ImageCard from './ImageCard.vue' import type { PassportClip } from '../types' import PassportClipCard from './PassportClip.vue' +import Modal from '@pages/passport/components/Modal.vue' const props = defineProps<{ clips: PassportClip[] }>() const i18nBase = i18nFactory(Strings) -let i18n = ref>(i18nBase(['en'])) +const i18n = ref>(i18nBase(['en'])) +const modalVisible = ref(false) +const modalItem = ref() +const handleOnClick = (item: PassportClip) => { + modalVisible.value = true + modalItem.value = item +} +const modalClose = () => { + modalVisible.value = false +} onMounted(async () => { i18n.value = i18nBase(navigator.languages) }) @@ -20,10 +30,31 @@ onMounted(async () => {