Files
xl-root/src/hooks/useUploadLength.js
2025-07-07 19:31:29 +08:00

18 lines
400 B
JavaScript

import {watch} from "vue";
import {Message} from "@arco-design/web-vue";
const useUploadLength = ({array, length}) => {
watch(
() => array,
(val) => {
if (val.length > length) {
Message.warning(`最多可上传${length}`);
val.length = length;
}
},
{deep: true,}
)
}
export default useUploadLength;