diff --git a/packages/taro-router/src/init.ts b/packages/taro-router/src/init.ts index f3e1dd2299e9..4e9b8bc36066 100644 --- a/packages/taro-router/src/init.ts +++ b/packages/taro-router/src/init.ts @@ -3,6 +3,7 @@ import { setHistoryMode } from './history' import { RouterConfig } from './router' export function init (config: RouterConfig) { + config.router.mode = config.router.mode || 'hash' setHistoryMode(config.router.mode, config.router.basename) Object.assign(routerConfig, config) document.getElementById('app')?.remove()