Skip to content

Commit

Permalink
fix(taro-cli): tabBar config跟进编译的不同小程序去取配置字段
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen-jj committed Oct 30, 2018
1 parent df2fae7 commit 31a0847
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/taro-cli/src/weapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -985,15 +985,16 @@ async function buildEntry () {
// 处理res.configObj 中的tabBar配置
const tabBar = res.configObj.tabBar
if (tabBar && typeof tabBar === 'object' && !Util.isEmptyObject(tabBar)) {
const list = tabBar.list || []
const {
list: listConfig,
iconPath: pathConfig,
selectedIconPath: selectedPathConfig
} = Util.CONFIG_MAP[buildAdapter]
const list = tabBar[listConfig] || []
let tabBarIcons = []
list.forEach(item => {
if (item.iconPath) {
tabBarIcons.push(item.iconPath)
}
if (item.selectedIconPath) {
tabBarIcons.push(item.selectedIconPath)
}
item[pathConfig] && tabBarIcons.push(item[pathConfig])
item[selectedPathConfig] && tabBarIcons.push(item[selectedPathConfig])
})
tabBarIcons = tabBarIcons.map(item => path.resolve(sourceDir, item))
if (tabBarIcons && tabBarIcons.length) {
Expand Down

0 comments on commit 31a0847

Please sign in to comment.