Skip to content

Commit

Permalink
chore: add withInMemoryScrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Dec 31, 2023
1 parent 5c212d0 commit 0f7f135
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { provideHttpClient, withFetch, withInterceptors } from '@angular/common/
import ngLang from '@angular/common/locales/zh';
import { APP_ID, ApplicationConfig, ErrorHandler, importProvidersFrom } from '@angular/core';
import { provideAnimations } from '@angular/platform-browser/animations';
import { provideRouter, withComponentInputBinding } from '@angular/router';
import { provideRouter, withComponentInputBinding, withInMemoryScrolling } from '@angular/router';
import { ServiceWorkerModule } from '@angular/service-worker';

import { provideNuMonacoEditorConfig } from '@ng-util/monaco-editor';
Expand Down Expand Up @@ -92,7 +92,7 @@ export const appConfig: ApplicationConfig = {
{ provide: APP_ID, useValue: 'ngAlainDoc' },
provideHttpClient(withFetch(), withInterceptors([mockInterceptor])),
provideAnimations(),
provideRouter(routes, withComponentInputBinding()),
provideRouter(routes, withComponentInputBinding(), withInMemoryScrolling({ scrollPositionRestoration: 'top' })),
// provideClientHydration(), // 暂时不开启水合,除了编译时间长,还有就是对DOM要求比较高
provideAlain({ config: alainConfig, defaultLang, i18nClass: I18NService }),
provideNzConfig(ngZorroConfig),
Expand Down

0 comments on commit 0f7f135

Please sign in to comment.