39 lines
888 B
Vue
39 lines
888 B
Vue
<template>
|
|
<el-dropdown @command="assignValue">
|
|
<el-button size="mini">
|
|
{{value.name}}<i class="el-icon-arrow-down el-icon--right"></i>
|
|
</el-button>
|
|
<el-dropdown-menu slot="dropdown">
|
|
<el-dropdown-item :command="item" v-for="(item,index) in list" :key="item.code||index">{{item.name||1111}}</el-dropdown-item>
|
|
</el-dropdown-menu>
|
|
</el-dropdown>
|
|
</template>
|
|
<script>
|
|
export default {
|
|
props: {
|
|
title: {
|
|
type: String,
|
|
default: 'drop down'
|
|
},
|
|
list: {
|
|
type: Array,
|
|
default: function () {
|
|
return [];
|
|
}
|
|
},
|
|
value:{
|
|
type:Object,
|
|
default:function(){
|
|
return {};
|
|
}
|
|
}
|
|
},
|
|
methods:{
|
|
assignValue:function(value){
|
|
this.$emit('input',value)
|
|
}
|
|
}
|
|
}
|
|
|
|
</script>
|