<template>
  <el-dropdown :splitButton="splitButton" @click="handleClick" :tabindex="tabindex" @command="handleCommand" :size="size" :trigger="trigger" :placement="placement">

    <span style="cursor: pointer">
      {{text}}<i class="el-icon-arrow-down el-icon--right"></i>
    </span>
    <slot slot="dropdown">
    </slot>
  </el-dropdown>
</template>

<script>
    export default {
        name: "index",
        props:{
            splitButton:{
                type:Boolean,
                default:false
            },
            type:{
                type:String,
                default:''
            },
            trigger:{
                type:String,
                default:'click'
            },
            size:{
                type:String,
                default:''
            },
            placement:{
                type:String,
                default:'bottom'
            },
            text:{
                type:String,
                default:'下拉菜单'
            },
            tabindex:{
                type:Number,
                default:0
            }
        },
        methods:{
            handleClick(v){
                this.$emit('click')
            },
            handleCommand(command){
                this.$emit('command',command)
            }
        }
    }
</script>

<style scoped>
  .el-dropdown-link {
    cursor: pointer;
    color: #409EFF;
  }
  .el-icon-arrow-down {
    font-size: 12px;
  }
</style>
