Skip to content

Commit 51afaf1

Browse files
author
davidysxue
committed
fix: demo
1 parent 77205d8 commit 51afaf1

File tree

3 files changed

+22
-34
lines changed

3 files changed

+22
-34
lines changed

tools/demo/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ App({
3030
globalData: {
3131
hasLogin: false,
3232
theme: 'light',
33-
GRID_DEMO_URL: '/example/index'
33+
GRID_DEMO_URL: '/example/index',
34+
iconTabbar: '/example/images/icon_tabbar.png'
3435
}
3536
})

tools/demo/example/grid/grid.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,53 @@
11
import CustomPage from '../../base/CustomPage'
22

33
const { GRID_DEMO_URL } = getApp().globalData
4+
const app = getApp()
45

56
CustomPage({
67
data: {
78
grids: [
89
{
9-
imgUrl: '/example/images/icon_tabbar.png',
10+
imgUrl: app.globalData.iconTabbar,
1011
url: GRID_DEMO_URL,
1112
text: 'Grid'
1213
},
1314
{
14-
imgUrl: '/example/images/icon_tabbar.png',
15+
imgUrl: app.globalData.iconTabbar,
1516
url: GRID_DEMO_URL,
1617
text: 'Grid'
1718
},
1819
{
19-
imgUrl: '/example/images/icon_tabbar.png',
20+
imgUrl: app.globalData.iconTabbar,
2021
url: GRID_DEMO_URL,
2122
text: 'Grid'
2223
},
2324
{
24-
imgUrl: '/example/images/icon_tabbar.png',
25+
imgUrl: app.globalData.iconTabbar,
2526
url: GRID_DEMO_URL,
2627
text: 'Grid'
2728
},
2829
{
29-
imgUrl: '/example/images/icon_tabbar.png',
30+
imgUrl: app.globalData.iconTabbar,
3031
url: GRID_DEMO_URL,
3132
text: 'Grid'
3233
},
3334
{
34-
imgUrl: '/example/images/icon_tabbar.png',
35+
imgUrl: app.globalData.iconTabbar,
3536
url: GRID_DEMO_URL,
3637
text: 'Grid'
3738
},
3839
{
39-
imgUrl: '/example/images/icon_tabbar.png',
40+
imgUrl: app.globalData.iconTabbar,
4041
url: GRID_DEMO_URL,
4142
text: 'Grid'
4243
},
4344
{
44-
imgUrl: '/example/images/icon_tabbar.png',
45+
imgUrl: app.globalData.iconTabbar,
4546
url: GRID_DEMO_URL,
4647
text: 'Grid'
4748
},
4849
{
49-
imgUrl: '/example/images/icon_tabbar.png',
50+
imgUrl: app.globalData.iconTabbar,
5051
url: GRID_DEMO_URL,
5152
text: 'Grid'
5253
}

tools/demo/example/tabbar/tabbar.js

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,31 @@
11
import CustomPage from '../../base/CustomPage'
22

3+
const app = getApp()
4+
35
CustomPage({
46
data: {
57
list: [
68
{
79
text: '微信',
8-
iconPath: global.isDemo
9-
? '/page/weui/example/images/icon_tabbar.png'
10-
: '/example/images/icon_tabbar.png',
11-
selectedIconPath: global.isDemo
12-
? '/page/weui/example/images/icon_tabbar.png'
13-
: '/example/images/icon_tabbar.png',
10+
iconPath: app.globalData.iconTabbar,
11+
selectedIconPath: app.globalData.iconTabbar,
1412
badge: '8'
1513
},
1614
{
1715
text: '通讯录',
18-
iconPath: global.isDemo
19-
? '/page/weui/example/images/icon_tabbar.png'
20-
: '/example/images/icon_tabbar.png',
21-
selectedIconPath: global.isDemo
22-
? '/page/weui/example/images/icon_tabbar.png'
23-
: '/example/images/icon_tabbar.png'
16+
iconPath: app.globalData.iconTabbar,
17+
selectedIconPath: app.globalData.iconTabbar
2418
},
2519
{
2620
text: '发现',
27-
iconPath: global.isDemo
28-
? '/page/weui/example/images/icon_tabbar.png'
29-
: '/example/images/icon_tabbar.png',
30-
selectedIconPath: global.isDemo
31-
? '/page/weui/example/images/icon_tabbar.png'
32-
: '/example/images/icon_tabbar.png',
21+
iconPath: app.globalData.iconTabbar,
22+
selectedIconPath: app.globalData.iconTabbar,
3323
dot: true
3424
},
3525
{
3626
text: '我',
37-
iconPath: global.isDemo
38-
? '/page/weui/example/images/icon_tabbar.png'
39-
: '/example/images/icon_tabbar.png',
40-
selectedIconPath: global.isDemo
41-
? '/page/weui/example/images/icon_tabbar.png'
42-
: '/example/images/icon_tabbar.png'
27+
iconPath: app.globalData.iconTabbar,
28+
selectedIconPath: app.globalData.iconTabbar
4329
}
4430
]
4531
},

0 commit comments

Comments
 (0)