<template>
    <div
        v-if="comName"
        :is="comName"
        v-bind="$props"
        v-on="$listeners">
        <!-- :cancelText="cancelText"
        :confirmText="confirmText"
        :nameText="nameText"
        :styleName="styleName"
        :isConfirm="isConfirm"
        @cancelChange="_cancel"
        @confirmChange="_confirm"> -->
        <slot></slot>
    </div>
</template>

<script>
import LayerTmp from './_comm/LayerTmp';
import NuLayercc from './layercc';
import NuLayercb from './layercb';

export default {
    extends: LayerTmp,
    name: 'NuLayer',
    components: {
        NuLayercc,
        NuLayercb
    },
    props: {
        /**
         * 展示的类型（textt,textl,textc）
         */
        type: {
            type: String,
            default: 'textc'
        },
        /**
         * 取消按钮显示的文本
         */
        cancelText: {
            type: String
        },
        /**
         * 样式（cb|rt）
         */
        styleName: {
            type: String,
            default: ''
        }
    },
    computed: {
        comName() { // 获取组件名
            let res = '';
            switch (this.type) {
                case 'layercb':
                    res = 'nu-layercb';
                    break;
                case 'layercc':
                default:
                    res = 'nu-layercc';
                    break;
            }
            return res;
        }
    }
};
</script>
