<template>
  <template v-if="openId">
    <template v-if="userInfo.userInfo.userNameNeedTranslate == 1">
      <template v-if="Array.isArray(openId)">
        <template v-for="(item, index) in openId">
          <ww-open-data :type='type' :openid='item'></ww-open-data>
          <span v-if="index < openId.length - 1">,</span>
        </template>
      </template>
      <ww-open-data :type='type' :openid='openId' v-else></ww-open-data>
    </template>
    <template v-else>
      {{ Array.isArray(openId) ? openId.join(',') : openId }}
    </template>
  </template>
  <template v-else>
    
  </template>
</template>

<script setup>
import { ref } from 'vue';
import { useLifecycle, useEnv } from '@hooks/useCommon.js';
import useInfoStore from '@store/useInfoStore'

const props = defineProps({
  openId: {
    type: [String, Number, Array],
    default: () => '',
  },
  type: {
    type: String,
    default: () => 'userName',
  }
});
const userInfo = useInfoStore()


useLifecycle({
  load: () => {
    // 添加加载逻辑
    // console.log(useEnv(), '<==== useEnv')
  }
});
</script>

<style lang='scss' scoped>
  /* 样式代码 */
</style>