<el-collapse v-model="activeNames" @change="handleChange"> <el-collapse-item name="1"> <span class="collapse-title" slot="title">{{ collapseTitle }}</span> </el-collapse-item> </el-collapse>
data() { return { collapseTitle: "查看更多", } }
<style lang="scss" scoped> // 使得标题与箭头位于中间 .collapse-title { // flex: 1 0 90%; //位于左侧 flex: 0 1 54%;// 位于中间 order: 1; } ::v-deep .el-collapse { border: none; }
// 使得标题与箭头位于内容的下方
.el-collapse-item { position: relative; }
::v-deep .el-collapse-item__header { padding: 20px; position: absolute; bottom: -40px; width: 100%; // background: red; } ::v-deep .el-collapse-item__content { padding-bottom: 0; }
// 原来是向右侧方向的箭头 // 点击后方向 /deep/ .el-collapse-item__arrow.is-active { transform: rotate(-90deg); } // 默认方向 /deep/ .el-collapse-item__arrow, .el-tabs__nav { transform: rotate(90deg); } </style>