refs #6890 change redirect #212

Merged
carlossa merged 4 commits from 6980-redirection into dev 2024-03-04 10:54:06 +00:00
1 changed files with 14 additions and 2 deletions
Showing only changes of commit e708e0cd6d - Show all commits

View File

@ -3,10 +3,16 @@ import { onMounted, ref, watch } from 'vue';
import axios from 'axios'; import axios from 'axios';
import SkeletonSummary from 'components/ui/SkeletonSummary.vue'; import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import { useRoute } from 'vue-router';
onMounted(() => fetch()); const route = useRoute();
const entity = ref(); const entity = ref();
const isSummary = ref(true);
onMounted(() => {
carlossa marked this conversation as resolved Outdated
Outdated
Review

Jo lo que habria possat es una prop requerida.
I el component que se encarrgue de fer la redireccio.
I gastant lo de isSummary mostres el boto o no

Jo lo que habria possat es una prop requerida. I el component que se encarrgue de fer la redireccio. I gastant lo de isSummary mostres el boto o no
isSummary.value = !String(route.path).endsWith('/summary');
fetch();
});
const props = defineProps({ const props = defineProps({
url: { url: {
type: String, type: String,
@ -48,7 +54,13 @@ watch(props, async () => {
<template v-if="entity"> <template v-if="entity">
<div class="summaryHeader bg-primary q-pa-md text-weight-bolder"> <div class="summaryHeader bg-primary q-pa-md text-weight-bolder">
<slot name="header-left"> <slot name="header-left">
<span></span> <span
><QIcon
carlossa marked this conversation as resolved Outdated
Outdated
Review

I la accio?

I la accio?
v-if="isSummary"
name="open_in_new"
color="white"
size="sm"
/></span>
</slot> </slot>
<slot name="header" :entity="entity"> <slot name="header" :entity="entity">
<VnLv :label="`${entity.id} -`" :value="entity.name" /> <VnLv :label="`${entity.id} -`" :value="entity.name" />