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

<script>
import ConfirmbarTmp from './_comm/ConfirmbarTmp';
import NuConfirmbars from './confirmbars';
import NuConfirmbarc from './confirmbarc';

export default {
    extends: ConfirmbarTmp,
    name: 'NuConfirmbar',
    props: {
        /**
         * 展示的类型（confirmbarc,confirmbars）
         */
        type: {
            type: String,
            default: 'confirmbarc'
        },
        /**
         * 行数
         */
        row: {
            type: Number,
            default: 2
        }
    },
    components: {
        NuConfirmbars,
        NuConfirmbarc
    },
    computed: {
        comName() { // 获取组件名
            let res = '';
            switch (this.type) {
                case 'confirmbarc':
                    res = 'nu-confirmbarc';
                    break;
                case 'confirmbars':
                    res = 'nu-confirmbars';
                    break;
                default:
                    res = 'nu-confirmbarc';
                    break;
            }
            return res;
        }
    }
};
</script>
