index.vue
984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<template>
<div>
<div class="bar-title" @click="changeStatus()">
<i class="el-icon-caret-right btn" v-if="!isExpansion"></i>
<i class="el-icon-caret-bottom btn" v-else></i>
<span class="title">{{name}}</span>
</div>
<slot v-if="isExpansion"></slot>
</div>
</template>
<script>
export default {
name: 'FoldFrame',
props: {
name: {
type: String,
default: ''
}
},
data() {
return {
isExpansion: true
}
},
methods: {
changeStatus(){
this.isExpansion = !this.isExpansion
}
}
}
</script>
<style lang="scss" scoped>
.bar-title{
font-weight: 600;
font-size: 14px;
color: #000000d9;
height: 40px;
line-height: 40px;
padding: 0 20px;
cursor: pointer;
.btn{
margin-right: 9px;
font-size: 16px;
}
}
</style>