1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-01 00:08:31 +09:00

差分表示をできるように

This commit is contained in:
CyberRex 2023-09-30 22:23:14 +09:00
parent 5d9d5b6819
commit a56d404b5d
No known key found for this signature in database
GPG Key ID: C1CD3C0860B46F02

View File

@ -176,16 +176,20 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<div v-else-if="tab === 'history'" :class="$style.tab_history">
<div style="display: grid;">
<div v-for="text in appearNote.noteEditHistory" :class="$style.historyRoot" :key="text">
<div v-for="(text, index) in appearNote.noteEditHistory" :key="text" :class="$style.historyRoot">
<MkAvatar :class="$style.avatar" :user="appearNote.user" link preview/>
<div :class="$style.historyMain">
<div :class="$style.historyHeader">
<MkUserName :user="appearNote.user" :nowrap="true"/>
</div>
<div>
<div>
<Mfm :text="text.trim()" :author="appearNote.user" :i="$i"/>
</div>
<CodeDiff
:old-string="appearNote.noteEditHistory[index - 1] || appearNote.noteEditHistory[0]"
:new-string="text"
:trim="true"
:hideHeader="true"
diffStyle="char"
/>
</div>
</div>
</div>
@ -205,7 +209,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
import { computed, inject, onMounted, ref, shallowRef } from 'vue';
import { computed, inject, onMounted, onUnmounted, ref, shallowRef } from 'vue';
import * as mfm from 'mfm-js';
import * as Misskey from 'misskey-js';
import MkNoteSub from '@/components/MkNoteSub.vue';
@ -240,6 +244,7 @@ import MkUserCardMini from '@/components/MkUserCardMini.vue';
import MkPagination, { Paging } from '@/components/MkPagination.vue';
import MkReactionIcon from '@/components/MkReactionIcon.vue';
import MkButton from '@/components/MkButton.vue';
import { CodeDiff } from 'v-code-diff';
const props = defineProps<{
note: Misskey.entities.Note;