1. 在使用element-ui的折疊面板時,點擊標題欄的按鈕不展開面板內(nèi)容:
<el-collapse v-model="activeNames">
<el-card class="box-card">
<el-collapse-item>
<template #title>
<div class="projectItem">
<div>
<!--面板標題-->
<p class="title">項目:{{ i.name }}</p>
</div>
<div @click.stop="showCollapse()">
<el-button @click="onShowEditDialog(i, index)">編輯</el-button>
<el-button @click="onRemoveProject(i.id)">刪除</el-button>
</div>
</div>
</template>
</el-collapse-item>
</el-card>
</el-collapse>
通過設置@click.stop="showCollapse()",阻止冒泡,點擊按鈕不再開展。
2.?想要改變折疊面板中icon位置
?找到折疊面板中icon位置,css設置如下:文章來源:http://www.zghlxwxcb.cn/news/detail-504028.html
.ep-collapse-item__arrow {
flex: 1 0 auto;
order: -1;
}
樣式如下文章來源地址http://www.zghlxwxcb.cn/news/detail-504028.html
到了這里,關于element UI中的折疊面板(el-collapse)點擊icon和標題展開的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!