/
cell.nvue
211 lines (201 loc) · 4.31 KB
/
cell.nvue
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<template>
<view class="cell-page">
<view class="u-page__item">
<text class="u-page__item__title">基础功能</text>
<up-cell-group>
<up-cell
title="uview-plus"
value="内容"
:isLink="true"
></up-cell>
<up-cell
title="利剑出鞘,一统江湖"
value="内容"
label="挣脱束缚,向往自由"
></up-cell>
</up-cell-group>
</view>
<view class="u-page__item">
<text class="u-page__item__title">自定义图标/图片</text>
<up-cell-group>
<up-cell
title="单元格"
icon="lock-fill"
></up-cell>
<up-cell
title="单元格"
icon="https://cdn.uviewui.com/uview/example/tag.png"
></up-cell>
</up-cell-group>
</view>
<view class="u-page__item">
<text class="u-page__item__title">自定义大小</text>
<up-cell-group>
<up-cell
size="large"
title="单元格"
value="内容"
isLink
></up-cell>
<up-cell
size="large"
title="单元格"
value="内容"
label="描述信息"
></up-cell>
</up-cell-group>
</view>
<view class="u-page__item">
<text class="u-page__item__title">显示右箭头</text>
<up-cell-group>
<up-cell
title="单元格"
value="组件"
isLink
></up-cell>
<up-cell
title="单元格"
value="工具"
arrow-direction="up"
isLink
></up-cell>
<up-cell
title="单元格"
value="模板"
arrow-direction="down"
isLink
></up-cell>
</up-cell-group>
</view>
<view class="u-page__item">
<text class="u-page__item__title">跳转页面</text>
<up-cell-group>
<up-cell
title="打开标签页"
isLink
url="/pages/componentsB/tag/tag"
></up-cell>
<up-cell
title="打开徽标页"
isLink
url="/pages/componentsB/badge/badge"
></up-cell>
</up-cell-group>
</view>
<view class="u-page__item">
<text class="u-page__item__title">右侧内容垂直居中</text>
<up-cell-group>
<up-cell
title="单元格"
value="内容"
label="描述信息"
center
></up-cell>
</up-cell-group>
</view>
<view class="u-page__item">
<text class="u-page__item__title">自定义插槽</text>
<up-cell-group>
<up-cell value="内容">
<template #title>
<view
class="u-slot-title"
>
<text class="u-cell-text">单元格</text>
<up-tag
text="标签"
plain
size="mini"
type="warning"
>
</up-tag>
</view>
</template>
</up-cell>
<up-cell
title="单元格"
isLink
>
<template #value>
<text
class="u-slot-value"
>99</text>
</template>
<template #right-icon>
1
</template>
</up-cell>
</up-cell-group>
</view>
<up-gap height="30"></up-gap>
</view>
</template>
<script>
export default {
data() {
return {}
},
methods: {
click() {
console.log('Cell is clicked.');
}
}
}
</script>
<style lang="scss">
.cell-page {
padding-bottom: 20px;
background-color: #f3f4f6;
}
.cell-box {
&__title {
font-size: 14px;
color: rgb(143, 156, 162);
margin: 20px 0px 0px 15px;
}
&__block {
// background-color: #fff;
margin-top: 10px;
}
}
.u-page {
padding: 0;
&__item {
margin-bottom: 10px;
&__title {
color: $u-tips-color;
padding: 10px 15px;
margin-bottom: 0px;
font-size: 15px;
&__slot-title {
color: $u-primary;
font-size: 14px;
}
}
:deep(.u-cell-group) {
background-color: #fff;
}
}
}
.u-slot-title {
@include flex;
flex-direction: row;
align-items: center;
}
.u-cell-text {
font-size: 15px;
line-height: 22px;
color: #303133;
margin-right: 5px;
}
.u-slot-value {
line-height: 17px;
text-align: center;
font-size: 10px;
padding: 0 5px;
height: 17px;
color: #FFFFFF;
border-radius: 100px;
background-color: #f56c6c; /* #ifndef APP-NVUE */ margin-left: auto; /* #endif */
}
</style>