<template>
    <div
        v-if="comName"
        :is="comName"
        v-bind="$props"
        v-on="$listeners">
        <!-- :imgUrl="imgUrl"
        :lazyOptions="lazyOptions"
        :isLazy="isLazy"
        :aspect="aspect"
        @click="_onClick"
        @tap="_onTap"> -->
        <slot></slot>
    </div>
</template>

<script>
import ImgTmp from './_comm/ImgTmp';
import NuImgae from './imgae';
import NuImgb from './imgb';
import NuImgc from './imgc';

export default {
    extends: ImgTmp,
    name: 'NuImg',
    components: {
        NuImgae,
        NuImgb,
        NuImgc
    },
    props: {
        /**
         * 展示的类型（imgc,imgb,imgae）
         */
        type: {
            type: String,
            default: 'imgc'
        }
    },
    computed: {
        comName() { // 获取组件名
            let res = '';
            switch (this.type) {
                case 'imgae':
                    res = 'nu-imgae';
                    break;
                case 'imgb':
                    res = 'nu-imgb';
                    break;
                case 'imgc':
                default:
                    res = 'nu-imgc';
                    break;
            }
            return res;
        }
    }
};
</script>
