fix #57
This commit is contained in:
parent
44d08b3e21
commit
70d2d33cbf
1 changed files with 16 additions and 2 deletions
|
|
@ -8,7 +8,9 @@
|
||||||
<span :data-icon="step.id">{{ step.label }}</span>
|
<span :data-icon="step.id">{{ step.label }}</span>
|
||||||
</h2>
|
</h2>
|
||||||
<div class="cards | flow">
|
<div class="cards | flow">
|
||||||
<component :is="cardsMap[step.id]" :step="step" />
|
<div ref="card-node">
|
||||||
|
<component :is="cardsMap[step.id]" :step="step" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -17,7 +19,7 @@
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import "dayjs/locale/fr";
|
import "dayjs/locale/fr";
|
||||||
import { usePageStore } from "../../stores/page";
|
import { usePageStore } from "../../stores/page";
|
||||||
import { computed } from "vue";
|
import { computed, onMounted, useTemplateRef } from "vue";
|
||||||
import { useProjectStore } from "../../stores/project";
|
import { useProjectStore } from "../../stores/project";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import ClientBrief from "./cards/ClientBrief.vue";
|
import ClientBrief from "./cards/ClientBrief.vue";
|
||||||
|
|
@ -46,6 +48,7 @@ dayjs.locale("fr");
|
||||||
|
|
||||||
const { page } = usePageStore();
|
const { page } = usePageStore();
|
||||||
const { setStatus } = useProjectStore();
|
const { setStatus } = useProjectStore();
|
||||||
|
const cardNode = useTemplateRef("card-node");
|
||||||
|
|
||||||
const steps = page.steps.map((item) => {
|
const steps = page.steps.map((item) => {
|
||||||
return item.value;
|
return item.value;
|
||||||
|
|
@ -60,6 +63,17 @@ const mergedFiles = computed(() => {
|
||||||
return [...staticFiles, ...dynamicFiles];
|
return [...staticFiles, ...dynamicFiles];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
onMounted(() => {
|
||||||
|
if (step.id === page.content.currentstep) {
|
||||||
|
cardNode.value.scrollIntoView({
|
||||||
|
behavior: "smooth",
|
||||||
|
inline: "center",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Functions
|
||||||
function getFrontView(track) {
|
function getFrontView(track) {
|
||||||
if (track.files.length === 1) return track.files[0];
|
if (track.files.length === 1) return track.files[0];
|
||||||
const xMax = parseInt(
|
const xMax = parseInt(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue