CreateButton.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!--
  2. bouton Créer
  3. -->
  4. <template>
  5. <main>
  6. <v-btn
  7. elevation="2"
  8. color="ot-warning text-ot-white"
  9. @click="showDialog=true"
  10. >
  11. {{ $t('create') }}
  12. </v-btn>
  13. <LayoutDialog :show="showDialog" >
  14. <template #dialogType>{{ $t('creative_assistant') }}</template>
  15. <template #dialogTitle>
  16. <span v-if="type === 'home'">{{ $t('what_do_you_want_to_create') }}</span>
  17. <span v-else-if="type === 'access'">{{ $t('universal_create_title_access') }}</span>
  18. <span v-else-if="type === 'event'">{{ $t('universal_create_title_event') }}</span>
  19. <span v-else-if="type === 'message'">{{ $t('universal_create_title_message') }}</span>
  20. </template>
  21. <template #dialogText>
  22. <LayoutHeaderUniversalCreationGenerateCardsSteps :step="step" @updateStep="updateStep" />
  23. </template>
  24. <template #dialogBtn>
  25. <div class="text-center">
  26. <v-btn
  27. color="ot-super-light-grey"
  28. @click="showDialog=false; step=1; type='home'"
  29. >
  30. {{ $t('cancel') }}
  31. </v-btn>
  32. <v-btn
  33. v-if="step > 1"
  34. color="ot-super_light_grey"
  35. @click="step=1; type='home'"
  36. >
  37. {{ $t('previous') }}
  38. </v-btn>
  39. </div>
  40. </template>
  41. </LayoutDialog>
  42. </main>
  43. </template>
  44. <script setup lang="ts">
  45. import {Ref, ref} from "@vue/reactivity";
  46. const showDialog: Ref<Boolean> = ref(false);
  47. const step: Ref<Number> = ref(1);
  48. const type: Ref<String> = ref('home');
  49. const updateStep = ({stepChoice, typeChoice}: any) =>{
  50. step.value = stepChoice
  51. type.value = typeChoice
  52. }
  53. </script>
  54. <style scoped>
  55. </style>