privacyPop.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <!-- 이용약관 -->
  3. <v-dialog v-model="props.privacyPop" persistent width="62.5rem">
  4. <div class="v-common-dialog-wrapper custom-dialog alert">
  5. <div class="modal-tit">
  6. <strong>{{ langType === 'kr' ? props.privacyDetail.kr.title : props.privacyDetail.en.title }}</strong>
  7. <button class="btn-close" @click="$emit('closePop');"></button>
  8. </div>
  9. <div class="flag--wrap">
  10. <div class="lang-set">
  11. <v-select v-model="langType" :items="langTypeList" @update:modelValue="fnLangChange" variant="outlined" style="width: 9.375rem; height: 2.25rem" class="custom-select"></v-select>
  12. </div>
  13. </div>
  14. <div class="v-common-dialog-content type--l">
  15. <div class="agree--contents border--top">
  16. <pre v-html="langType == 'kr' ? props.privacyDetail.kr.contents : props.privacyDetail.en.contents"></pre>
  17. </div>
  18. </div>
  19. <div class="btn-wrap">
  20. <div class="inner--btn--wrap">
  21. <v-btn class="custom-btn btn-blue mini" @click="$emit('closePop')"><i class="ico"></i>확인</v-btn>
  22. </div>
  23. </div>
  24. </div>
  25. </v-dialog>
  26. </template>
  27. <script setup>
  28. /***********************
  29. * import
  30. ************************/
  31. import useUtil from '@/composables/useUtil';
  32. import { useI18n } from 'vue-i18n';
  33. /***********************
  34. * plugins inject
  35. ************************/
  36. const {$toast, $log, $dayjs, $eventBus } = useNuxtApp()
  37. // props
  38. const props = defineProps({
  39. privacyPop: Boolean,
  40. privacyDetail: Object
  41. })
  42. // 다국어
  43. const langTypeList = ref({})
  44. const langType = ref('')
  45. const emit = defineEmits(["closePop"])
  46. const i18n = useI18n()
  47. watchEffect(() =>{
  48. // 감시하고자 하는 데이터를 해당 블럭내에서 사용하면 호출된다.
  49. // getLang.value를 감시하는 상태
  50. fnGetEnumCode(useLangStore().getLang)
  51. })
  52. /***********************
  53. * data & created
  54. ************************/
  55. /**
  56. * @SCRIPT
  57. * 다국어 기능 | 한글 영문 변경 이벤트
  58. */
  59. function fnLangChange() {
  60. useLangStore().setLang(langType.value)
  61. }
  62. function fnGetEnumCode(lang){
  63. lang = useUtil.nvl(lang, 'kr')
  64. langType.value = lang
  65. let objEnum = useEnumCode.getEnumCode(lang)
  66. langTypeList.value = objEnum.langType
  67. i18n.locale.value = lang
  68. }
  69. /***********************
  70. * Methods
  71. ************************/
  72. </script>