18 lines
400 B
JavaScript
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;
|