|
|
@ -14,11 +14,11 @@ |
|
|
|
<span :style="{width:item.width+'px'||'auto'}" :class="[item.width?'ellipsis':'']">{{ item.label }}</span> |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
<el-dropdown placement="top-start" v-if="showList().length>3"> |
|
|
|
<el-dropdown placement="top-start" v-if="showList().length>2"> |
|
|
|
<el-button link class="more" type="primary"> 更多 </el-button> |
|
|
|
<template #dropdown> |
|
|
|
<el-dropdown-menu> |
|
|
|
<el-dropdown-item v-for="(item, index) in getMoreList" :key="index+3" class="btn-div"> |
|
|
|
<el-dropdown-item v-for="(item, index) in getMoreList" :key="index+2" class="btn-div"> |
|
|
|
<el-button |
|
|
|
v-show="!item.hide" |
|
|
|
:type="item.type" |
|
|
@ -80,13 +80,13 @@ const showList = ()=>{ |
|
|
|
} |
|
|
|
const getMoreList = computed(()=>{ |
|
|
|
let list = showList() |
|
|
|
return list.slice(3) |
|
|
|
return list.slice(2) |
|
|
|
}) |
|
|
|
const getButtonList = computed(()=>{ |
|
|
|
let list = showList() |
|
|
|
if(list.length>3){ |
|
|
|
if(list.length>2){ |
|
|
|
console.log('list===',list) |
|
|
|
return list.slice(0, 3) |
|
|
|
return list.slice(0, 2) |
|
|
|
} |
|
|
|
return list |
|
|
|
}) |
|
|
|