1. export default vs export
示例对比:
// 方式一:默认导出(你当前用的)
const wechatConfig = { appId: 'xxx' }
export default wechatConfig
// 导入
import wechatConfig from '@/config'
// 方式二:命名导出
export const wechatConfig = { appId: 'xxx' }
export const otherConfig = { ... }
// 导入
import { wechatConfig } from '@/config'
// 或者同时导入多个
import { wechatConfig, otherConfig } from '@/config'
建议:配置文件通常用默认导出就够了。