fix: new posts click
This commit is contained in:
parent
e2f60e20dc
commit
4f1c71a8d5
2 changed files with 10 additions and 6 deletions
|
@ -12,7 +12,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #default="{ items: notes }">
|
<template #default="{ items: notes }">
|
||||||
<div class="giivymft" :class="{ noGap }">
|
<div class="giivymft" :class="{ noGap }" ref="tlEl">
|
||||||
<XList
|
<XList
|
||||||
ref="notes"
|
ref="notes"
|
||||||
v-slot="{ item: note }"
|
v-slot="{ item: note }"
|
||||||
|
@ -41,6 +41,9 @@ import XNote from "@/components/MkNote.vue";
|
||||||
import XList from "@/components/MkDateSeparatedList.vue";
|
import XList from "@/components/MkDateSeparatedList.vue";
|
||||||
import MkPagination from "@/components/MkPagination.vue";
|
import MkPagination from "@/components/MkPagination.vue";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
|
import { scroll } from "@/scripts/scroll";
|
||||||
|
|
||||||
|
const tlEl = ref<HTMLElement>();
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
pagination: Paging;
|
pagination: Paging;
|
||||||
|
@ -49,8 +52,13 @@ const props = defineProps<{
|
||||||
|
|
||||||
const pagingComponent = ref<InstanceType<typeof MkPagination>>();
|
const pagingComponent = ref<InstanceType<typeof MkPagination>>();
|
||||||
|
|
||||||
|
function scrollTop() {
|
||||||
|
scroll(tlEl.value, { top: 0, behavior: 'smooth' })
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
pagingComponent,
|
pagingComponent,
|
||||||
|
scrollTop
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<div v-if="queue > 0" class="new">
|
<div v-if="queue > 0" class="new">
|
||||||
<button
|
<button
|
||||||
class="_buttonPrimary _shadow"
|
class="_buttonPrimary _shadow"
|
||||||
@click="scrollTop"
|
@click="tlComponent.scrollTop()"
|
||||||
:class="{ instant: !$store.state.animation }"
|
:class="{ instant: !$store.state.animation }"
|
||||||
>
|
>
|
||||||
{{ i18n.ts.newNoteRecived }}
|
{{ i18n.ts.newNoteRecived }}
|
||||||
|
@ -37,7 +37,6 @@ import * as sound from "@/scripts/sound";
|
||||||
import { $i } from "@/account";
|
import { $i } from "@/account";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import { defaultStore } from "@/store";
|
import { defaultStore } from "@/store";
|
||||||
import { scroll } from "@/scripts/scroll";
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
src: string;
|
src: string;
|
||||||
|
@ -223,9 +222,6 @@ function closeHint() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function scrollTop() {
|
|
||||||
scroll(tlComponent, { top: 0, behavior: 'smooth' })
|
|
||||||
}
|
|
||||||
|
|
||||||
const pagination = {
|
const pagination = {
|
||||||
endpoint: endpoint,
|
endpoint: endpoint,
|
||||||
|
|
Loading…
Reference in a new issue