config参数

config 含有APP的基础相关配置。

# config.js

const env = require('./env');
const setStorageSyncField = require('./setStorageSync-field');

// 全局配置
const config = {
  title: 'QQ:2052021114',
  currentService: env.currentService,
  serverUrl: env.EVENTHOST,
  pages: [],
  routes: {},
  // 保存到本地的字段
  setStorageSyncField: {
    ...setStorageSyncField
  },
  // 本地存储时间 天
  storageExpired:365,
  // 资源
  staticUrl: '',
  //不填就不记录, 错误日记 'production' | ['production', 'development']
  errorLog: 'development',
  // 底部导航参数配置
  footerTabConfig: {
    max: 5, // 最大值
    min: 2, // 最小值
  }
}
export default config;

  • title APP 标题
  • currentService APP各种环境
  • serverUrl 当前使用的环境 API使用的地址
  • pages pages.json 中的 pages 的路由列表
  • routes 经过处理带有别名跳转的路由表
  • setStorageSyncField 本地缓存的字段对象(方便管理)
  • storageExpired 本地存储时间 默认365天
  • staticUrl 静态资源服务域名(可选)
  • errorLog 错误日记开关,不填就不记录, 错误日记 'production' | ['production', 'development']
  • footerTabConfig 底部导航参数配置 默认最多含有5个,最少2个