feat: add isModal prop
This commit is contained in:
parent
e6c660c20b
commit
c3668d961b
|
@ -77,6 +77,7 @@ export function useRouteWithModal() {
|
||||||
|
|
||||||
const props = getRouteProps(route)
|
const props = getRouteProps(route)
|
||||||
|
|
||||||
|
props.isModal = true
|
||||||
props.backdropRoutePath = backdropRoute.value.fullPath
|
props.backdropRoutePath = backdropRoute.value.fullPath
|
||||||
props.onClose = closeModal
|
props.onClose = closeModal
|
||||||
|
|
||||||
|
|
|
@ -447,8 +447,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {ref, reactive, toRef, shallowReactive, computed, watch, nextTick, type PropType, useAttrs} from 'vue'
|
import {ref, reactive, toRef, shallowReactive, computed, watch, nextTick, type PropType} from 'vue'
|
||||||
import {useRouter, type RouteLocation} from 'vue-router'
|
import {useRouter} from 'vue-router'
|
||||||
import {useI18n} from 'vue-i18n'
|
import {useI18n} from 'vue-i18n'
|
||||||
import {unrefElement} from '@vueuse/core'
|
import {unrefElement} from '@vueuse/core'
|
||||||
import cloneDeep from 'lodash.clonedeep'
|
import cloneDeep from 'lodash.clonedeep'
|
||||||
|
@ -507,8 +507,9 @@ const props = defineProps({
|
||||||
type: Number as PropType<ITask['id']>,
|
type: Number as PropType<ITask['id']>,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
backdropRoutePath: {
|
isModal: {
|
||||||
type: String as PropType<RouteLocation['fullPath']>,
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -580,8 +581,6 @@ const color = computed(() => {
|
||||||
|
|
||||||
const hasAttachments = computed(() => attachmentStore.attachments.length > 0)
|
const hasAttachments = computed(() => attachmentStore.attachments.length > 0)
|
||||||
|
|
||||||
const isModal = computed(() => Boolean(props.backdropRoutePath))
|
|
||||||
|
|
||||||
function attachmentUpload(file: File, onSuccess?: (url: string) => void) {
|
function attachmentUpload(file: File, onSuccess?: (url: string) => void) {
|
||||||
return uploadFile(taskId.value, file, onSuccess)
|
return uploadFile(taskId.value, file, onSuccess)
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue