Skip to content

Commit

Permalink
use +keepScrollPosition
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Sep 25, 2024
1 parent 803fa06 commit e169831
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 1 addition & 2 deletions examples/full/pages/starship/+Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ function Layout({ children }: { children: React.ReactNode }) {
}

function Link(props: any) {
// We set `keep-scroll-position` to tell Vike to preserve the current scroll position
return <a keep-scroll-position="" style={{ marginRight: 10, ...props.style }} {...props} />
return <a style={{ marginRight: 10, ...props.style }} {...props} />
}

function Counter() {
Expand Down
8 changes: 8 additions & 0 deletions examples/full/pages/starship/+config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export { config }

import type { Config } from 'vike/types'

const config = {
// https://vike.dev/keepScrollPosition
keepScrollPosition: true,
} satisfies Config

0 comments on commit e169831

Please sign in to comment.