<template>
    <BaseSameLayer
        :hosSameLayerArgs="hosSameLayerArgs"
        embedType="native/midea-time-pave"
        :defaultWidth="300"
        :defaultHeight="300"
    ></BaseSameLayer>
</template>

<script>
import BaseSameLayer from './baseSameLayer.vue'

export default {
    data() {
        return {
            width: 0,
            height: 0
        }
    },
    name: "MideaTimePave",
    components: {
        BaseSameLayer
    },
    props: {
        hosUniqueProps: {
            type: Object,
            default() {
                return {}
            }
        },
        value: {
            type: String,
            required: true
        }
    },
    computed: {
        hosSameLayerArgs() {
            return {
                ...this.hosUniqueProps,// 鸿蒙原生组件独有属性
                width: this.width,
                height: this.height,
                value: this.value,
                onScrollCompleted: this.onScollCompleted
            }
        }
    },
    mounted() {
        this.width = this.$el.clientWidth;
        this.height = this.$el.clientHeight;
    },

    methods: {
        onScollCompleted(res) {
            this.$emit("change", res)
        },
    },
};
</script>
