Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
fix: add toutiao getIcons function (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pochodaydayup authored and yesmeck committed Aug 29, 2019
1 parent d8dd841 commit d46af4e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/remax-cli/src/build/adapters/toutiao/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,21 @@ export function getNativePropName(prop: string) {

return prop;
}

export function getIcons(config: any) {
if (!config.tabBar) {
return [];
}

const tabs: { iconPath: string; selectedIconPath: string }[] =
config.tabBar.list;

if (tabs) {
return tabs.reduce<string[]>(
(images, tab) => [...images, tab.iconPath, tab.selectedIconPath],
[]
);
}

return [];
}

0 comments on commit d46af4e

Please sign in to comment.