<template>
    <div
        v-if="comName"
        :is="comName"
        v-bind="$props"
        v-on="$listeners">
        <!-- :nameText="nameText"
        :size="size" -->
        <slot></slot>
    </div>
</template>

<script>
import LoadingTmp from './_comm/LoadingTmp';
import NuLoadingl from './loadingl';
import NuLoadingc from './loadingc';
export default {
    extends: LoadingTmp,
    name: 'NuLoading',
    components: {
        NuLoadingl,
        NuLoadingc
    },
    props: {
        /**
         * 展示的类型（loadingl,loadingc）
         */
        type: {
            type: String,
            default: 'loadingc'
        }
    },
    computed: {
        comName() { // 获取组件名
            let res = '';
            switch (this.type) {
                case 'loadingl':
                    res = 'nu-loadingl';
                    break;
                case 'loadingc':
                default:
                    res = 'nu-loadingc';
                    break;
            }
            return res;
        }
    }
};
</script>
