textTranslation.vue 823 B

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