Skip to content

Commit 09c0b0e

Browse files
committed
update: 去除折叠面板嵌套list示例
1 parent 5977179 commit 09c0b0e

1 file changed

Lines changed: 3 additions & 57 deletions

File tree

‎pages/extUI/collapse/collapse.nvue‎

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@
55
<uni-section :title="item.name" type="line"></uni-section>
66
<uni-collapse ref="add" class="warp" @change="change">
77
<uni-collapse-item v-for="(sub, key) in item.data" :key="key" :open="sub.open" :show-animation="sub.showAnimation" :disabled="sub.disabled" :title="sub.subName">
8-
<template v-if="!sub.type">
9-
<text class="content">{{ sub.content }}</text>
10-
</template>
11-
<template v-else>
12-
<uni-list>
13-
<uni-list-item v-for="(list, listIndex) in sub.subList" :key="listIndex" :title="list.title" :note="list.note" :thumb="list.thumb" :show-extra-icon="list.showExtraIcon" :extra-icon="list.extraIcon" :show-switch="list.showSwitch" @switchChange="change" />
14-
</uni-list>
15-
</template>
8+
<text class="content">{{ sub.content }}</text>
169
</uni-collapse-item>
1710
</uni-collapse>
1811
</view>
@@ -37,17 +30,13 @@
3730
<script>
3831
import uniCollapse from '@/components/uni-collapse/uni-collapse.vue'
3932
import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue'
40-
import uniList from '@/components/uni-list/uni-list.vue'
41-
import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
4233
import uniSection from '@/components/uni-section/uni-section.vue'
4334

4435
export default {
4536
components: {
4637
uniSection,
4738
uniCollapse,
48-
uniCollapseItem,
49-
uniList,
50-
uniListItem
39+
uniCollapseItem
5140
},
5241
data() {
5342
const listData = [{
@@ -63,30 +52,6 @@
6352
subName: '折叠内容',
6453
content: '折叠列表内容,这是一段比较长内容。默认折叠主要内容,只显示当前项标题。点击标题展开,才能看到这段问题。再次点击标题,折叠内容。'
6554
},
66-
{
67-
type: true,
68-
subName: '折叠列表',
69-
subList: [{
70-
title: '标题文字',
71-
thumb: 'https://img-cdn-qiniu.dcloud.net.cn/new-page/uni.png'
72-
},
73-
{
74-
title: '标题文字',
75-
note: '描述信息',
76-
thumb: 'https://img-cdn-qiniu.dcloud.net.cn/new-page/uni.png'
77-
},
78-
{
79-
title: '标题文字',
80-
showExtraIcon: true,
81-
extraIcon: {
82-
color: '#4cd964',
83-
size: '26',
84-
type: 'image'
85-
},
86-
showSwitch: true
87-
}
88-
]
89-
},
9055
{
9156
type: false,
9257
subName: '禁用状态',
@@ -101,26 +66,7 @@
10166
type: true,
10267
subName: '折叠列表',
10368
showAnimation: true,
104-
subList: [{
105-
title: '标题文字',
106-
thumb: 'https://img-cdn-qiniu.dcloud.net.cn/new-page/uni.png'
107-
},
108-
{
109-
title: '标题文字',
110-
note: '描述信息',
111-
thumb: 'https://img-cdn-qiniu.dcloud.net.cn/new-page/uni.png'
112-
},
113-
{
114-
title: '标题文字',
115-
showExtraIcon: true,
116-
extraIcon: {
117-
color: '#4cd964',
118-
size: '26',
119-
type: 'image'
120-
},
121-
showSwitch: true
122-
}
123-
]
69+
content: '折叠列表内容,这是一段比较长内容。默认折叠主要内容,只显示当前项标题。点击标题展开,才能看到这段问题。再次点击标题,折叠内容。'
12470
}]
12571
}
12672
]

0 commit comments

Comments
 (0)