import {watch} from "vue";
import {showToast} from "../utils/uils.js";

const useUploadLength = ({array, length}) => {
    watch(
        () => array,
        (val) => {
            if (val.length > length) {
                showToast(`最多可上传${length}个`);
                val.length = length;
            }
        },
        {deep: true,}
    )
}

export default useUploadLength;
