微信给出了自己开发的IDE,与文件管理目录,不谈一些细微的瑕疵,开发的体验还是很好的,
一、app.json文件
项目结构所在的文件
只需在其中"pages":[
"pages/index/index",
"pages/bind/bind",
"pages/mine/mine",
"pages/login/login",
"pages/control/control",
"pages/share/share"
],
加入需要的页面,IDE会自动帮你生成样式、js文件、json文件以及xml文件
app.json文件还可以为应用创造Tabbar,只需要
"tabBar": {
"color": "#959394",
"selectedColor": "#959394",
"backgroundColor": "#f0f0f0",
"borderStyle": "white",
"list": [{
"pagePath": "pages/index/index",
"iconPath":"image/tabbar/home_tabbar_22x22_.png",
"selectedIconPath":"image/tabbar/home_tabbar_press_22x22_@2x.png",
"text": "设备列表"
}, {
"pagePath": "pages/bind/bind",
"iconPath":"image/tabbar/video_tabbar_22x22_.png",
"selectedIconPath":"image/tabbar/machine_tabbar_press_22x22_@2x.png",
"text": "绑定设备"
},{
"pagePath": "pages/mine/mine",
"iconPath":"image/tabbar/mine_tabbar_22x22_.png",
"selectedIconPath":"image/tabbar/mine_tabbar_press_22x22_@2x.png",
"text": "我的"
}]
}
如此搭配即可(我练手的是重构了之前用安卓写的一个物联网应用,通过协议控制设备)
看起来还不错^ ^