subTitleBar.vue
1.65 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<template>
<view
class="subTitleBar"
@click.stop="click"
>
<view class="left">
<view class="titleLine"></view>
<text class="titleText">{{ title }}</text>
</view>
<view
v-if="showArrow"
class="right"
>
<image
v-if="isOpen"
src="@/devTools/page/static/fold.png"
class="arrow"
/>
<image
v-else
src="@/devTools/page/static/unfold.png"
class="arrow"
/>
</view>
</view>
</template>
<script>
export default {
emits: ['click'],
props: {
/**
* 标题名称
*/
title: {
type: String,
default: "标题",
},
/**
* 是否显示右侧箭头
*/
showArrow: {
type: Boolean,
default: true,
},
/**
* 是否为开启状态
*/
isOpen: {
type: Boolean,
default: false,
},
},
data() {
return {};
},
methods: {
click(){
this.$emit('click');
},
}
};
</script>
<style lang="scss" scoped>
.subTitleBar {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 20rpx 0;
width: 750rpx;
&:active {
background-color: rgba(0, 0, 0, 0.05);
}
.left {
display: flex;
flex-direction: row;
align-items: center;
margin-left: 20rpx;
.titleLine {
width: 4rpx;
height: 24rpx;
border-radius: 4px;
background-color: #ff2d55;
}
.titleText {
color: #333;
margin-left: 10rpx;
font-size: 24rpx;
line-height: 24rpx;
}
}
.right {
margin-right: 20rpx;
.arrow {
width: 30rpx;
height: 30rpx;
}
}
}
</style>