<template>
  <div class="table-img">
    <el-image style="width: 60px; height: 60px" :src="pathImg" fit="contain" />
  </div>
  
</template>

<script setup>
  import { ref } from 'vue'
  const { proxy } = getCurrentInstance();

  const pathUrl = ref('')
  const emit = defineEmits();
  const pathImg = ref('')
  const props = defineProps({
    propConfig:{},
    propValue:{},
    parentValue:{}
  })

  // const pathImg=() => {
  //   let n = props.propValue;
  //   if(n){
  //     try{
  //       let d = JSON.parse(n);
  //       if(d[0]){
  //         n = d[0]
  //       }
  //     }catch(e){
  //       console.log('图片转换失败')
  //     }
  //   }
  //   return n;
  // }

  if(props.propValue){
    // pathImg.value = props.propValue
    try{
      let d = JSON.parse(props.propValue);
      if(d[0]){
        pathImg.value = d[0]
      }
    }catch(e){
      console.log('图片转换失败')
    }
  }
</script>

<style lang="scss" scoped>
.table-img{
  height: 50px;
  width: 50px;
  border: solid 1px #EEE;
  overflow: hidden;
  display: flex;
  align-items: center;
  >img{
    width: 100%;
  }
}
</style>