Skip to content

Commit 9ae8a20

Browse files
author
xuqingkai
committed
docs: ✏️ demo首页使用Cell组件重构显示样式
1 parent ef574cf commit 9ae8a20

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

src/pages/index/Index.vue

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
<text class="version">@{{ packageConfig.version }}</text>
1010
</view>
1111
</view>
12-
<view class="page__desc">
13-
Wot Design Uni 是移动端 Vue 组件库 Wot Design 的 uni-app 版本,两者基于相同的视觉规范,提供一致的 API 接口,助力开发者快速搭建 uni-app
14-
应用。
15-
</view>
12+
<view class="page__desc">Wot Design Uni 是一个基于Vue3+TS开发的uni-app组件库,提供60+高质量组件,支持暗黑模式、国际化和自定义主题。</view>
1613
</view>
1714
<view class="page__bd">
1815
<block v-for="(item, index) in list" :key="index">
@@ -23,12 +20,13 @@
2320
</view>
2421
<view :class="['kind-list__item-bd', item.open ? 'kind-list__item-bd_show' : '']">
2522
<view :class="['wd-cells', item.open ? 'wd-cells_show' : '']">
26-
<block v-for="(page, j) in item.pages" :key="j">
27-
<navigator :url="`/pages/${page.id}/Index`" class="wd-cell wd-flex wd-cell_access">
28-
<view class="wd-flex__item page-name">{{ page.name }}</view>
29-
<view class="wd-cell__ft wd-tool-right-line-angle"></view>
30-
</navigator>
31-
</block>
23+
<wd-cell
24+
v-for="(page, j) in item.pages"
25+
:key="j"
26+
is-link
27+
:label="page.name"
28+
@click="handleClick(`/pages/${page.id}/Index`)"
29+
></wd-cell>
3230
</view>
3331
</view>
3432
</view>
@@ -364,6 +362,12 @@ const list = ref([
364362
}
365363
])
366364
365+
function handleClick(url: string) {
366+
uni.navigateTo({
367+
url
368+
})
369+
}
370+
367371
function kindToggle(id: string) {
368372
const listValue = list.value
369373
for (let i = 0, len = listValue.length; i < len; ++i) {
@@ -385,8 +389,8 @@ function kindToggle(id: string) {
385389
.title {
386390
color: $-dark-color;
387391
}
388-
.page-name {
389-
color: $-dark-color3;
392+
:deep(.wd-cell__label) {
393+
color: $-dark-color3 !important;
390394
}
391395
.kind-list__img {
392396
filter: invert(100%);
@@ -430,9 +434,7 @@ function kindToggle(id: string) {
430434
.version {
431435
font-size: 14px;
432436
}
433-
.wd-flex {
434-
align-items: center;
435-
}
437+
436438
.wd-cell_access {
437439
padding: 15px 20px;
438440
}
@@ -446,6 +448,9 @@ function kindToggle(id: string) {
446448
opacity: 0;
447449
transform: translateY(-50%);
448450
transition: 0.3s;
451+
:deep(.wd-cell__label) {
452+
color: rgba(0, 0, 0, 0.65);
453+
}
449454
}
450455
.wd-cells_show {
451456
opacity: 1;

0 commit comments

Comments
 (0)