<template>
  <BaseSameLayer
      :hosSameLayerArgs="hosSameLayerArgs"
      embedType="native/image"
      :defaultWidth="300"
      :defaultHeight="120"
  ></BaseSameLayer>
</template>
<script>

import BaseSameLayer from "./baseSameLayer.vue";

const weexModule = weex.requireModule('weexModule');
export default {
  name: "HlImage",
  components: {
    BaseSameLayer,
  },
  props: {
    src: {
      type: String,
      required: true,
    },
    hosUniqueProps:{
      type: Object,
      required: true,
    },
  },
  methods: {
    save(callback) {
      console.log("testxxxxx", "image 组件 save 方法被触发")
      weexModule.callNative('imageSaveHandle', {src: this.src,},callback)
    },
    handleLoad(res) {
      this.$emit("load", res);
    },
  },
  computed: {
    hosSameLayerArgs() {
      return {
        ...this.hosUniqueProps, // 鸿蒙原生组件独有属性
        src: this.src,
        handleLoad: this.handleLoad,
      }
    }
  },
  watch: {
  },
};
</script>

<style scoped>
</style>