优化插件细节

This commit is contained in:
神仙都没用 2024-03-06 15:47:59 +08:00
parent dae7e482d7
commit d783f473f9
4 changed files with 18 additions and 6 deletions

View File

@ -5,8 +5,8 @@ import Crud, { locale, setFocus } from "@cool-vue/crud";
import "@cool-vue/crud/dist/index.css";
// 调试、自定义crud
// import Crud, { locale, setFocus } from "../../../packages/crud/src";
// import "../../../packages/crud/src/static/index.scss";
// import Crud, { locale, setFocus } from "/~/crud/src";
// import "/~/crud/src/static/index.scss";
export default (): Merge<ModuleConfig, CrudOptions> => {
return {

View File

@ -14,6 +14,7 @@ export default (): ModuleConfig => {
}
],
// 组件依赖过大,如不需求请注释以下代码
components: [() => import("./components/monaco.vue")]
};
};

View File

@ -41,7 +41,7 @@
item-key="uid"
:disabled="!draggable"
@end="update"
v-if="showFileList"
v-if="showList"
>
<!-- 触发器 -->
<template #footer>
@ -120,7 +120,7 @@
<script lang="ts" setup name="cl-upload">
import { computed, ref, watch, type PropType, nextTick } from "vue";
import { isArray, isNumber } from "lodash-es";
import { isArray, isEmpty, isNumber } from "lodash-es";
import VueDraggable from "vuedraggable";
import { ElMessage } from "element-plus";
import { PictureFilled, UploadFilled } from "@element-plus/icons-vue";
@ -247,6 +247,15 @@ const headers = computed(() => {
//
const list = ref<Upload.Item[]>([]);
//
const showList = computed(() => {
if (props.type == "file") {
return !isEmpty(list.value);
} else {
return true;
}
});
//
const accept = computed(() => {
return props.accept || (props.type == "file" ? "" : "image/*");
@ -505,7 +514,9 @@ defineExpose({
}
&__file-btn {
margin-bottom: 10px;
& + .cl-upload__list {
margin-top: 10px;
}
}
:deep(.el-upload) {

File diff suppressed because one or more lines are too long