- 게시물 상세를 default 레이아웃으로 통합해 홈↔게시물 레이아웃 교체 제거 - CSS 전환 베일·스크롤 정리 플러그인으로 이동 중 깜빡임 완화 Co-authored-by: Cursor <cursoragent@cursor.com>
26 lines
590 B
JavaScript
26 lines
590 B
JavaScript
import { setPendingScrollRestore } from '../lib/site-route-transition.js'
|
|
|
|
/**
|
|
* 라우터 스크롤 동작
|
|
* 클라이언트에서는 scrollBehavior가 직접 스크롤하지 않고,
|
|
* 전환 베일 뒤에서 `site-page-transition.client.js`가 스크롤을 적용한다.
|
|
* @type {import('vue-router').RouterScrollBehavior}
|
|
*/
|
|
export default (to, from, savedPosition) => {
|
|
if (import.meta.server) {
|
|
return { top: 0, left: 0 }
|
|
}
|
|
|
|
if (to.hash) {
|
|
return {
|
|
el: to.hash
|
|
}
|
|
}
|
|
|
|
if (savedPosition) {
|
|
setPendingScrollRestore(savedPosition)
|
|
}
|
|
|
|
return false
|
|
}
|