|
|
@ -1,12 +1,10 @@ |
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
|
|
|
import type { ImageUploadOptions } from '@vben/plugins/tiptap'; |
|
|
|
|
|
|
|
|
import { computed, ref } from 'vue'; |
|
|
import { computed, ref } from 'vue'; |
|
|
|
|
|
|
|
|
import { Page } from '@vben/common-ui'; |
|
|
import { Page } from '@vben/common-ui'; |
|
|
import { |
|
|
import { VbenTiptap, VbenTiptapPreview } from '@vben/plugins/tiptap'; |
|
|
type ImageUploadOptions, |
|
|
|
|
|
VbenTiptap, |
|
|
|
|
|
VbenTiptapPreview, |
|
|
|
|
|
} from '@vben/plugins/tiptap'; |
|
|
|
|
|
|
|
|
|
|
|
import { Card, Switch } from 'ant-design-vue'; |
|
|
import { Card, Switch } from 'ant-design-vue'; |
|
|
const content = ref(` |
|
|
const content = ref(` |
|
|
@ -36,7 +34,7 @@ const imageUpload: ImageUploadOptions = { |
|
|
if (progress >= 100) { |
|
|
if (progress >= 100) { |
|
|
// 上传完成后返回 mock URL |
|
|
// 上传完成后返回 mock URL |
|
|
resolve( |
|
|
resolve( |
|
|
`https://picsum.photos/seed/${Date.now()}/640/${Math.round(640 * (file.size % 3 + 2) / 4)}`, |
|
|
`https://picsum.photos/seed/${Date.now()}/640/${Math.round((640 * ((file.size % 3) + 2)) / 4)}`, |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
}, 300); |
|
|
}, 300); |
|
|
|