refactor editor

This commit is contained in:
Timi
2026-08-25 17:35:42 +08:00
parent bc375e1b2d
commit 13bd61326d
40 changed files with 4444 additions and 55 deletions
+32
View File
@@ -0,0 +1,32 @@
<template>
<article-view
:article="articleValue"
:empty-text="emptyText"
:resolve-attachment-url="resolveAttachmentUrl"
/>
</template>
<script lang="ts" setup>
import type { Article, ArticleContentType, Attachment, NotifyDetail } from "timi-web/editor";
import { ArticleView } from "../article-view";
import { normalizeNotifyContentType } from "timi-web/editor";
defineOptions({
name: "NotifyView"
});
const props = withDefaults(defineProps<{
detail?: NotifyDetail;
emptyText?: string;
resolveAttachmentUrl?: (attachmentId: string, attachment?: Attachment) => string | Promise<string>;
}>(), {
detail: () => ({}),
emptyText: "暂无通知内容"
});
const articleValue = computed<Article>(() => ({
contentType: normalizeNotifyContentType(props.detail?.contentType) as ArticleContentType,
content: props.detail?.content || "",
attachmentList: props.detail?.attachmentList
}));
</script>