+
@@ -24,88 +33,90 @@
-
\ No newline at end of file
+}
+
diff --git a/src/components/IconSelect/requireIcons.js b/src/components/IconSelect/requireIcons.js
index ac22fd7..196e4ed 100644
--- a/src/components/IconSelect/requireIcons.js
+++ b/src/components/IconSelect/requireIcons.js
@@ -1,8 +1,8 @@
-let icons = []
-const modules = import.meta.glob('./../../assets/icons/svg/*.svg');
+let icons = [];
+const modules = import.meta.glob("./../../assets/icons/svg/*.svg");
for (const path in modules) {
- const p = path.split('assets/icons/svg/')[1].split('.svg')[0];
+ const p = path.split("assets/icons/svg/")[1].split(".svg")[0];
icons.push(p);
}
-export default icons
\ No newline at end of file
+export default icons;
diff --git a/src/components/ImagePreview/index.vue b/src/components/ImagePreview/index.vue
index b607ab6..412f2c6 100644
--- a/src/components/ImagePreview/index.vue
+++ b/src/components/ImagePreview/index.vue
@@ -20,16 +20,16 @@ import { isExternal } from "@/utils/validate";
const props = defineProps({
src: {
type: String,
- default: ""
+ default: "",
},
width: {
type: [Number, String],
- default: ""
+ default: "",
},
height: {
type: [Number, String],
- default: ""
- }
+ default: "",
+ },
});
const realSrc = computed(() => {
@@ -49,7 +49,7 @@ const realSrcList = computed(() => {
}
let real_src_list = props.src.split(",");
let srcList = [];
- real_src_list.forEach(item => {
+ real_src_list.forEach((item) => {
if (isExternal(item)) {
return srcList.push(item);
}
diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue
index 55dafb8..d1976b8 100644
--- a/src/components/ImageUpload/index.vue
+++ b/src/components/ImageUpload/index.vue
@@ -68,7 +68,7 @@ const props = defineProps({
// 是否显示提示
isShowTip: {
type: Boolean,
- default: true
+ default: true,
},
});
@@ -86,26 +86,30 @@ const showTip = computed(
() => props.isShowTip && (props.fileType || props.fileSize)
);
-watch(() => props.modelValue, val => {
- if (val) {
- // 首先将值转为数组
- const list = Array.isArray(val) ? val : props.modelValue.split(",");
- // 然后将数组转为对象数组
- fileList.value = list.map(item => {
- if (typeof item === "string") {
- if (item.indexOf(baseUrl) === -1) {
- item = { name: baseUrl + item, url: baseUrl + item };
- } else {
- item = { name: item, url: item };
+watch(
+ () => props.modelValue,
+ (val) => {
+ if (val) {
+ // 首先将值转为数组
+ const list = Array.isArray(val) ? val : props.modelValue.split(",");
+ // 然后将数组转为对象数组
+ fileList.value = list.map((item) => {
+ if (typeof item === "string") {
+ if (item.indexOf(baseUrl) === -1) {
+ item = { name: baseUrl + item, url: baseUrl + item };
+ } else {
+ item = { name: item, url: item };
+ }
}
- }
- return item;
- });
- } else {
- fileList.value = [];
- return [];
- }
-},{ deep: true, immediate: true });
+ return item;
+ });
+ } else {
+ fileList.value = [];
+ return [];
+ }
+ },
+ { deep: true, immediate: true }
+);
// 上传前loading加载
function handleBeforeUpload(file) {
@@ -115,7 +119,7 @@ function handleBeforeUpload(file) {
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
- isImg = props.fileType.some(type => {
+ isImg = props.fileType.some((type) => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
@@ -161,7 +165,7 @@ function handleUploadSuccess(res, file) {
// 删除图片
function handleDelete(file) {
- const findex = fileList.value.map(f => f.name).indexOf(file.name);
+ const findex = fileList.value.map((f) => f.name).indexOf(file.name);
if (findex > -1 && uploadList.value.length === number.value) {
fileList.value.splice(findex, 1);
emit("update:modelValue", listToString(fileList.value));
@@ -172,7 +176,9 @@ function handleDelete(file) {
// 上传结束处理
function uploadedSuccessfully() {
if (number.value > 0 && uploadList.value.length === number.value) {
- fileList.value = fileList.value.filter(f => f.url !== undefined).concat(uploadList.value);
+ fileList.value = fileList.value
+ .filter((f) => f.url !== undefined)
+ .concat(uploadList.value);
uploadList.value = [];
number.value = 0;
emit("update:modelValue", listToString(fileList.value));
@@ -208,6 +214,6 @@ function listToString(list, separator) {
\ No newline at end of file
+
diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue
index 38de953..8200733 100644
--- a/src/components/Pagination/index.vue
+++ b/src/components/Pagination/index.vue
@@ -1,5 +1,5 @@
-