Răsfoiți Sursa

优化插件细节

神仙都没用 1 an în urmă
părinte
comite
d783f473f9

+ 2 - 2
src/plugins/crud/config.ts

@@ -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 {

+ 1 - 0
src/plugins/editor-monaco/config.ts

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

+ 14 - 3
src/plugins/upload/components/upload.vue

@@ -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) {

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
stats.html


Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff