Index.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. 'use strict';
  2. import {createStackNavigator} from 'react-navigation-stack';
  3. import NavigationOptions from '../../components/NavbarOptions';
  4. import SalesHome from './Home';
  5. import ReportCustomerList from './ReportCustomerList';
  6. const HomeStack = createStackNavigator({
  7. SalesHome: {
  8. screen: SalesHome,
  9. navigationOptions: {
  10. title: '首页',
  11. },
  12. },
  13. ReportCustomerList: {
  14. screen: ReportCustomerList,
  15. navigationOptions: {
  16. title: '客户报备',
  17. },
  18. },
  19. },
  20. {
  21. initialRouteName: 'SalesHome',
  22. defaultNavigationOptions: NavigationOptions,
  23. //mode: 'modal',
  24. //headerMode: 'none',
  25. },
  26. );
  27. HomeStack.navigationOptions = ({navigation}) => { // ~注意~ 如果想实现隐藏Tabbar的功能要调用这个方法
  28. let tabBarVisible = true;
  29. if (navigation.state.index > 0) {
  30. tabBarVisible = false;
  31. }
  32. return {
  33. tabBarVisible,
  34. };
  35. };
  36. module.exports = HomeStack;