feat: add isModal prop

This commit is contained in:
Dominik Pschenitschni 2022-11-22 18:41:30 +01:00
parent e6c660c20b
commit c3668d961b
Signed by: dpschen
GPG Key ID: B257AC0149F43A77
2 changed files with 6 additions and 6 deletions

View File

@ -77,6 +77,7 @@ export function useRouteWithModal() {
const props = getRouteProps(route)
props.isModal = true
props.backdropRoutePath = backdropRoute.value.fullPath
props.onClose = closeModal

View File

@ -447,8 +447,8 @@
</template>
<script lang="ts" setup>
import {ref, reactive, toRef, shallowReactive, computed, watch, nextTick, type PropType, useAttrs} from 'vue'
import {useRouter, type RouteLocation} from 'vue-router'
import {ref, reactive, toRef, shallowReactive, computed, watch, nextTick, type PropType} from 'vue'
import {useRouter} from 'vue-router'
import {useI18n} from 'vue-i18n'
import {unrefElement} from '@vueuse/core'
import cloneDeep from 'lodash.clonedeep'
@ -507,8 +507,9 @@ const props = defineProps({
type: Number as PropType<ITask['id']>,
required: true,
},
backdropRoutePath: {
type: String as PropType<RouteLocation['fullPath']>,
isModal: {
type: Boolean,
default: false,
},
})
@ -580,8 +581,6 @@ const color = computed(() => {
const hasAttachments = computed(() => attachmentStore.attachments.length > 0)
const isModal = computed(() => Boolean(props.backdropRoutePath))
function attachmentUpload(file: File, onSuccess?: (url: string) => void) {
return uploadFile(taskId.value, file, onSuccess)
}