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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
| <template>
| <view
| class="tui-cell-class tui-list-cell"
| :class="{ 'tui-cell-arrow': arrow, 'tui-cell-last': last, 'tui-line-left': lineLeft, 'tui-line-right': lineRight, 'tui-radius': radius }"
| :hover-class="hover ? 'tui-cell-hover' : ''"
| :style="{ background: bgcolor, fontSize: size + 'rpx', color: color, padding: padding}"
| :hover-stay-time="150"
| @tap="handleClick"
| >
| <slot></slot>
| <image src="/static/images/navigator-1.png" class="arrow" v-if="arrow"></image>
| <!-- <view class="iconfont iconarrow-right arrow" v-if="arrow"></view> -->
| </view>
| </template>
|
| <script>
| export default {
| name: "ListCell",
| props: {
| //是否有箭头
| arrow: {
| type: Boolean,
| default: false
| },
| //是否有点击效果
| hover: {
| type: Boolean,
| default: true
| },
| //left 30rpx
| lineLeft:{
| type: Boolean,
| default: false
| },
| //right 30rpx
| lineRight:{
| type: Boolean,
| default: false
| },
| padding:{
| type:String,
| default:"26rpx 30rpx"
| },
| last: {
| type: Boolean,
| default: false //最后一条数据隐藏线条
| },
| radius:{
| type:Boolean,
| default:false
| },
| bgcolor: {
| type: String,
| default: "#fff" //背景颜色
| },
| size: {
| type: Number,
| default: 28 //字体大小
| },
| color: {
| type: String,
| default: "#5A5B5C" //字体颜色
| },
| index: {
| type: Number,
| default: 0
| }
| },
| methods: {
| handleClick() {
| this.$emit('click', {
| index: this.index
| });
| }
| }
| }
| </script>
|
| <style lang="scss" scoped>
| .tui-list-cell {
| position: relative;
| width: 100%;
| box-sizing: border-box;
| overflow: hidden;
| display: flex;
| align-items: center;
| }
| .tui-radius {
| border-radius: 12rpx;
| overflow: hidden;
| }
|
| .tui-cell-hover {
| background: #f7f7f9 !important;
| }
|
| .tui-list-cell::after {
| content: '';
| position: absolute;
| border-bottom: 2rpx solid #eee;
| -webkit-transform: scaleY(0.8);
| transform: scaleY(0.8);
| bottom: 0;
| right: 0;
| left: 0;
| }
| .tui-line-left::after {
| left: 30rpx !important;
| }
|
| .tui-line-right::after {
| right: 30rpx !important;
| }
|
| .tui-cell-last::after {
| border-bottom: 0 !important;
| }
|
| // .arrow {
| // font-size: 44rpx;
| // line-height: 100%;
| // color: $text-color-grey;
| // position: relative;
| // margin-right: -12rpx;
| // }
| .arrow {
| width: 50rpx;
| height: 50rpx;
| position: relative;
| margin-right: -10rpx;
| flex-shrink: 0;
| }
| </style>
|
|