enhance(frontend): タイムライン以外でもスクロール位置の保持を試みるように
This commit is contained in:
parent
35d4b43c95
commit
6d90e09a58
3 changed files with 33 additions and 13 deletions
|
|
@ -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' });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue