1
0
mirror of https://git.boykissers.com/pawkey/pawkey-sk.git synced 2025-12-20 04:04:16 +00:00

enhance(frontend): タイムライン以外でもスクロール位置の保持を試みるように

This commit is contained in:
syuilo
2025-04-16 10:35:05 +09:00
parent 35d4b43c95
commit 6d90e09a58
3 changed files with 33 additions and 13 deletions

View File

@@ -20,6 +20,7 @@ import { useTemplateRef } from 'vue';
import { scrollInContainer } from '@@/js/scroll.js';
import type { PageHeaderItem } from '@/types/page-header.js';
import type { Tab } from './MkPageHeader.tabs.vue';
import { useScrollPositionKeeper } from '@/use/use-scroll-position-keeper.js';
const props = withDefaults(defineProps<{
tabs?: Tab[];
@@ -35,6 +36,8 @@ const props = withDefaults(defineProps<{
const tab = defineModel<string>('tab');
const rootEl = useTemplateRef('rootEl');
useScrollPositionKeeper(rootEl);
defineExpose({
scrollToTop: () => {
if (rootEl.value) scrollInContainer(rootEl.value, { top: 0, behavior: 'smooth' });