react-native-navigation的迁移库

BottomTabs.js 457B

1234567891011121314151617181920
  1. const { forEach } = require('lodash');
  2. const Container = require('./Container');
  3. class BottomTabs {
  4. /**
  5. * @constructor
  6. * @typedef {Object} BottomTabs
  7. * @property {Container[]} tabs
  8. */
  9. constructor(tabs) {
  10. if (!tabs || tabs.length === 0) {
  11. throw new Error('BottomTabs undefined');
  12. }
  13. this.tabs = [];
  14. forEach(tabs, (tab) => this.tabs.push({ container: new Container(tab.container) }));
  15. }
  16. }
  17. module.exports = BottomTabs;