mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2026-01-28 01:08:13 +00:00
优化插件细节
This commit is contained in:
parent
dae7e482d7
commit
d783f473f9
@ -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 {
|
||||
|
||||
@ -14,6 +14,7 @@ export default (): ModuleConfig => {
|
||||
}
|
||||
],
|
||||
|
||||
// 组件依赖过大,如不需求请注释以下代码
|
||||
components: [() => import("./components/monaco.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) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user