virtual sample : create virtual sample store, activate dl image btn

This commit is contained in:
isUnknown 2024-11-21 10:08:37 +01:00
parent a98665313f
commit fc576e917b
4 changed files with 147 additions and 8 deletions

View file

@ -31,17 +31,22 @@
<h2 class="font-serif text-lg">Échantillon virtuel</h2>
</template>
<Dynamic v-if="activeTab === 'dynamic'" />
<Static v-if="activeTab === 'static'" />
<DynamicView v-if="activeTab === 'dynamic'" />
<StaticView v-if="activeTab === 'static'" />
<template #footer>
<button
<a
v-if="currentFile"
id="download-image"
class="btn btn--white-10"
data-icon="download"
:href="currentFile.url"
download
>
<span>Sauvegarder limage</span>
</button>
<span>{{
activeTab === "dynamic" ? "Télécharger limage" : "Télécharger le PDF"
}}</span>
</a>
<button
id="loop-animation"
class="btn btn--transparent btn--outline"
@ -72,21 +77,22 @@
<script setup>
import { storeToRefs } from "pinia";
import Dialog from "primevue/dialog";
import Dynamic from "./Dynamic.vue";
import Static from "./Static.vue";
import DynamicView from "./DynamicView.vue";
import StaticView from "./StaticView.vue";
import { ref } from "vue";
import { useDialogStore } from "../../../stores/dialog";
import { useVirtualSampleStore } from "../../../stores/virtualSample";
const { file } = defineProps({
file: Object,
});
const { comments } = storeToRefs(useDialogStore());
const { activeTab, currentFile } = storeToRefs(useVirtualSampleStore());
// Variables
const isOpen = ref(true);
const isCommentsOpen = ref(false);
const activeTab = ref("dynamic");
</script>
<style scoped>