refactor:基于 lint 处理排版
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
import type { Editor as EditorType } from 'tinymce/tinymce';
|
||||
import type { IPropTypes } from '@tinymce/tinymce-vue/lib/cjs/main/ts/components/EditorPropTypes';
|
||||
type InitOptions = IPropTypes['init'];
|
||||
import type { PropType } from 'vue';
|
||||
import type { Editor as EditorType } from 'tinymce/tinymce';
|
||||
|
||||
import Editor from '@tinymce/tinymce-vue';
|
||||
import ImgUpload from './img-upload.vue';
|
||||
import type { PropType } from 'vue';
|
||||
|
||||
import {
|
||||
computed,
|
||||
@@ -21,12 +18,21 @@ import {
|
||||
} from 'vue';
|
||||
|
||||
import { preferences, usePreferences } from '@vben/preferences';
|
||||
import { buildShortUUID, isNumber } from '@vben/utils';
|
||||
|
||||
import Editor from '@tinymce/tinymce-vue';
|
||||
|
||||
import { isNumber, buildShortUUID } from '@vben/utils';
|
||||
import { bindHandlers } from './helper';
|
||||
import { plugins as defaultPlugins, toolbar as defaultToolbar } from './tinymce';
|
||||
import { useUpload } from '#/components/upload/use-upload';
|
||||
|
||||
import { bindHandlers } from './helper';
|
||||
import ImgUpload from './img-upload.vue';
|
||||
import {
|
||||
plugins as defaultPlugins,
|
||||
toolbar as defaultToolbar,
|
||||
} from './tinymce';
|
||||
|
||||
type InitOptions = IPropTypes['init'];
|
||||
|
||||
defineOptions({ inheritAttrs: false });
|
||||
|
||||
const props = defineProps({
|
||||
@@ -300,8 +306,8 @@ function handleError(name: string) {
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
const content = editor?.getContent()?? '';
|
||||
const val = content?.replace(getUploadingImgName(name), '')?? '';
|
||||
const content = editor?.getContent() ?? '';
|
||||
const val = content?.replace(getUploadingImgName(name), '') ?? '';
|
||||
setValue(editor, val);
|
||||
}
|
||||
</script>
|
||||
@@ -349,4 +355,4 @@ function handleError(name: string) {
|
||||
:deep(.tox-promotion) {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
<script lang="ts" setup>
|
||||
import type { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
|
||||
|
||||
import { Upload, Button } from 'ant-design-vue';
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { $t } from '@vben/locales';
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { Button, Upload } from 'ant-design-vue';
|
||||
|
||||
import { useUpload } from '#/components/upload/use-upload';
|
||||
|
||||
defineOptions({ name: 'TinymceImageUpload' });
|
||||
@@ -14,7 +16,8 @@ const props = defineProps({
|
||||
default: false,
|
||||
type: Boolean,
|
||||
},
|
||||
fullscreen: { // 图片上传,是否放到全屏的位置
|
||||
fullscreen: {
|
||||
// 图片上传,是否放到全屏的位置
|
||||
default: false,
|
||||
type: Boolean,
|
||||
},
|
||||
@@ -45,7 +48,7 @@ async function customRequest(info: UploadRequestOption<any>) {
|
||||
try {
|
||||
const url = await httpRequest(file);
|
||||
emit('done', name, url);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
emit('error', name);
|
||||
} finally {
|
||||
uploading.value = false;
|
||||
|
||||
Reference in New Issue
Block a user