<template>
  <view class="dec-img-block">
    <image
      class="img-block"
      mode="widthFix"
      v-if="img"
      :src="img"
      :show-menu-by-longpress="tab.type == 'imageBlock'"
    />
    <view class="img-block img-default" v-else>自定义图片区域</view>
  </view>
</template>
<script>
export default {
  inject: ["decImgDomain"],
  props: {
    tab: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      img: "",
    };
  },
  created() {
    const img = this.tab.arg && this.tab.arg.img;
    console.log(this.tab, "tab");
    this.img = this.decImgDomain(img || "");
  },
};
</script>
