-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
69 lines (67 loc) · 1.51 KB
/
index.js
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
Page({
onShareAppMessage() {
return {
title: 'UBI',
path: 'page/component/index'
}
},
data: {
list: [
{
id: 'view',
name: '视图容器',
open: false,
pages: ['view', 'scroll-view', 'swiper', 'movable-view', 'cover-view']
}, {
id: 'content',
name: '基础内容',
open: false,
pages: ['text', 'icon', 'progress', 'rich-text']
}, {
id: 'form',
name: '表单组件',
open: false,
pages: ['button', 'checkbox', 'form', 'input', 'label', 'picker', 'picker-view', 'radio', 'slider', 'switch', 'textarea']
}, {
id: 'nav',
name: '导航',
open: false,
pages: ['navigator']
}, {
id: 'media',
name: '媒体组件',
open: false,
pages: ['image', 'audio', 'video', 'camera']
}, {
id: 'map',
name: '地图',
open: false,
pages: ['map']
}, {
id: 'canvas',
name: '画布',
open: false,
pages: ['canvas']
}, {
id: 'open',
name: '开放能力',
open: false,
pages: ['ad', 'open-data', 'web-view']
}
]
},
kindToggle(e) {
const id = e.currentTarget.id
const list = this.data.list
for (let i = 0, len = list.length; i < len; ++i) {
if (list[i].id === id) {
list[i].open = !list[i].open
} else {
list[i].open = false
}
}
this.setData({
list
})
}
})