textTranslation.vue 721 B

123456789101112131415161718192021222324252627
  1. <template>
  2. <template v-if="!translationVal">
  3. {{ translationValue }}
  4. </template>
  5. <template v-else>
  6. <ww-open-data :type="translationTypes" :openid="translationValue"></ww-open-data>
  7. </template>
  8. </template>
  9. <script lang="ts" setup>
  10. import { ref, reactive, onMounted, inject, watchEffect, computed } from 'vue';
  11. import { useStore } from '@/store/index'
  12. import { storeToRefs } from 'pinia';
  13. interface Props {
  14. translationTypes: translationType;
  15. translationValue: string;
  16. }
  17. const props = defineProps<Props>();
  18. const { userInfo } = storeToRefs(useStore());
  19. const translationVal = ref(false);
  20. onMounted(() => {
  21. translationVal.value = userInfo.value.userNameNeedTranslate == 0 ? false : true;
  22. })
  23. </script>