mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2026-02-06 08:05:35 +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";
|
import "@cool-vue/crud/dist/index.css";
|
||||||
|
|
||||||
// 调试、自定义crud
|
// 调试、自定义crud
|
||||||
// import Crud, { locale, setFocus } from "../../../packages/crud/src";
|
// import Crud, { locale, setFocus } from "/~/crud/src";
|
||||||
// import "../../../packages/crud/src/static/index.scss";
|
// import "/~/crud/src/static/index.scss";
|
||||||
|
|
||||||
export default (): Merge<ModuleConfig, CrudOptions> => {
|
export default (): Merge<ModuleConfig, CrudOptions> => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -14,6 +14,7 @@ export default (): ModuleConfig => {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
// 组件依赖过大,如不需求请注释以下代码
|
||||||
components: [() => import("./components/monaco.vue")]
|
components: [() => import("./components/monaco.vue")]
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
item-key="uid"
|
item-key="uid"
|
||||||
:disabled="!draggable"
|
:disabled="!draggable"
|
||||||
@end="update"
|
@end="update"
|
||||||
v-if="showFileList"
|
v-if="showList"
|
||||||
>
|
>
|
||||||
<!-- 触发器 -->
|
<!-- 触发器 -->
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@ -120,7 +120,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup name="cl-upload">
|
<script lang="ts" setup name="cl-upload">
|
||||||
import { computed, ref, watch, type PropType, nextTick } from "vue";
|
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 VueDraggable from "vuedraggable";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import { PictureFilled, UploadFilled } from "@element-plus/icons-vue";
|
import { PictureFilled, UploadFilled } from "@element-plus/icons-vue";
|
||||||
@ -247,6 +247,15 @@ const headers = computed(() => {
|
|||||||
// 列表
|
// 列表
|
||||||
const list = ref<Upload.Item[]>([]);
|
const list = ref<Upload.Item[]>([]);
|
||||||
|
|
||||||
|
// 显示上传列表
|
||||||
|
const showList = computed(() => {
|
||||||
|
if (props.type == "file") {
|
||||||
|
return !isEmpty(list.value);
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// 文件格式
|
// 文件格式
|
||||||
const accept = computed(() => {
|
const accept = computed(() => {
|
||||||
return props.accept || (props.type == "file" ? "" : "image/*");
|
return props.accept || (props.type == "file" ? "" : "image/*");
|
||||||
@ -505,7 +514,9 @@ defineExpose({
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__file-btn {
|
&__file-btn {
|
||||||
margin-bottom: 10px;
|
& + .cl-upload__list {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-upload) {
|
:deep(.el-upload) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user