2020-01-29 19:37:25 +00:00
|
|
|
<template>
|
2021-11-19 10:36:12 +00:00
|
|
|
<div v-sticky-container class="yrzkoczt">
|
2021-10-16 09:18:41 +00:00
|
|
|
<MkTab v-model="with_" class="tab">
|
2020-12-26 01:47:36 +00:00
|
|
|
<option :value="null">{{ $ts.notes }}</option>
|
|
|
|
<option value="replies">{{ $ts.notesAndReplies }}</option>
|
|
|
|
<option value="files">{{ $ts.withFiles }}</option>
|
2020-11-28 15:18:54 +00:00
|
|
|
</MkTab>
|
2021-04-16 15:12:50 +00:00
|
|
|
<XNotes ref="timeline" :no-gap="true" :pagination="pagination" @before="$emit('before')" @after="e => $emit('after', e)"/>
|
2020-01-29 19:37:25 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 11:12:00 +00:00
|
|
|
import { defineComponent } from 'vue';
|
2021-11-11 17:02:25 +00:00
|
|
|
import XNotes from '@/components/notes.vue';
|
|
|
|
import MkTab from '@/components/tab.vue';
|
|
|
|
import * as os from '@/os';
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2020-10-17 11:12:00 +00:00
|
|
|
export default defineComponent({
|
2020-01-29 19:37:25 +00:00
|
|
|
components: {
|
2020-11-28 15:18:54 +00:00
|
|
|
XNotes,
|
|
|
|
MkTab,
|
2020-01-29 19:37:25 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
user: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
date: null,
|
|
|
|
with_: null,
|
|
|
|
pagination: {
|
|
|
|
endpoint: 'users/notes',
|
|
|
|
limit: 10,
|
|
|
|
params: init => ({
|
|
|
|
userId: this.user.id,
|
|
|
|
includeReplies: this.with_ === 'replies',
|
|
|
|
withFiles: this.with_ === 'files',
|
|
|
|
untilDate: init ? undefined : (this.date ? this.date.getTime() : undefined),
|
|
|
|
})
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
2021-11-19 10:36:12 +00:00
|
|
|
|
|
|
|
watch: {
|
|
|
|
user() {
|
|
|
|
this.$refs.timeline.reload();
|
|
|
|
},
|
|
|
|
|
|
|
|
with_() {
|
|
|
|
this.$refs.timeline.reload();
|
|
|
|
},
|
|
|
|
},
|
2020-01-29 19:37:25 +00:00
|
|
|
});
|
|
|
|
</script>
|
2021-04-13 18:23:29 +00:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.yrzkoczt {
|
|
|
|
> .tab {
|
2021-10-16 09:18:41 +00:00
|
|
|
margin: calc(var(--margin) / 2) 0;
|
|
|
|
padding: calc(var(--margin) / 2) 0;
|
2021-04-13 18:23:29 +00:00
|
|
|
background: var(--bg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|