kaban > step uri : fix reactivity problem
This commit is contained in:
parent
82e944cd31
commit
9b5a61e57d
2 changed files with 9 additions and 7 deletions
|
|
@ -34,7 +34,9 @@
|
||||||
</article>
|
</article>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
import DateTime from "./DateTime.vue";
|
import DateTime from "./DateTime.vue";
|
||||||
|
import { computed } from "vue";
|
||||||
|
|
||||||
const { step, pdf, index } = defineProps({
|
const { step, pdf, index } = defineProps({
|
||||||
step: Object,
|
step: Object,
|
||||||
|
|
@ -46,11 +48,11 @@ const { step, pdf, index } = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const uri =
|
const route = useRoute();
|
||||||
location.pathname + "?dialog=" + step.slug + "&fileIndex=" + getIndex();
|
|
||||||
|
|
||||||
function getIndex() {
|
const uri = computed(() => {
|
||||||
if (index) return index;
|
const fileIndex =
|
||||||
return step.files.findIndex((file) => file.type === "document");
|
index ?? step.files.findIndex((file) => file.type === "document");
|
||||||
}
|
return `${route.fullPath}?dialog=${step.slug}&fileIndex=${fileIndex}`;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import Header from "../components/project/Header.vue";
|
||||||
import DialogWrapper from "../components/project/DialogWrapper.vue";
|
import DialogWrapper from "../components/project/DialogWrapper.vue";
|
||||||
import { usePageStore } from "../stores/page";
|
import { usePageStore } from "../stores/page";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import { watch } from "vue";
|
import { computed, watch } from "vue";
|
||||||
import { useDialogStore } from "../stores/dialog";
|
import { useDialogStore } from "../stores/dialog";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue