el

发布时间:2024-12-06 08:58

最新推荐文章于 2024-10-16 20:38:40 发布

前端小芬芬 于 2023-04-13 14:14:32 发布

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

<template>

<div>

<el-collapse v-model="activeNames" @change="handleChange">

<el-collapse-item v-for="(item, index) in list" :key="index" :name="index">

<template #title>

<span class="collapse-title flex" slot="title"

>{{ item.name }}

<div class="collapse-title-right flex">

<span @click.stop="toEdit">编辑</span>

</div>

</span>

</template>

<template #right-icon>

<el-icon><ele-CaretBottom /></el-icon>

</template>

<div>{{ item.content }}</div>

</el-collapse-item>

</el-collapse>

</div>

</template>

<script setup>

const list = [

{

name: '名称1',

id: 12,

content: '1Consistent within interface: all elements should be consistent, such as: design style, icons and texts, position of elements, etc.',

},

{

name: '名称2',

id: 23,

content: '2Consistent within interface: all elements should be consistent, such as: design style, icons and texts, position of elements, etc.',

},

];

const activeNames = ref([0, 1]);

const handleChange = (val) => {

console.log(val);

};

const toEdit = () => {

console.log(111);

};

</script>

<style lang="scss">

.el-collapse-item__arrow {

margin-right: 5px;

font-size: 8px;

color: #0164fe;

&:before {

// 要替换的icon

content: '\e620';

font-family: 'iconfont';

font-size: 8px;

font-style: normal;

color: #0164fe;

margin-right: 10px;

}

}

.el-collapse-item__arrow.is-active {

transform: rotate(90deg);

margin-top: 14px;

margin-left: -6px;

margin-right: 10px;

}

.collapse-title {

height: 44px !important;

line-height: 44px;

flex: 1 0 90%;

order: 1;

justify-content: space-between;

}

.el-collapse-item__header {

height: 44px !important;

flex: 1 0 auto;

order: -1;

background: #e7efff;

padding: 0 20px;

border-bottom: 1px solid #ffffff;

}

.collapse-title-right {

span {

color: #0e64f1;

cursor: pointer;

&:hover {

text-decoration: underline;

}

}

}

.el-collapse-item__content {

padding: 20px;

}

.el-collapse-item__wrap {

border: none;

}

</style>

网址:el https://www.yuejiaxmz.com/news/view/394045

相关内容

vue el
El Largo Invierno = The Long Winter
Gerardo el Guepardo = Charlie the Cheetah
vue技巧
element ui 弹出组件的遮罩层在弹出层的上面的解决方法:modal
自动化测试框架工具pytest教程
element
【计算机毕设论文】基于SpringBoot图片热量估计系统
JavaScript常用优化分享(三)
关于slot

随便看看