refactor editor
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user