parent component
<script setup>
...
const uploading = ref(false);
const temporaryFiles = ref([]);
function isAllUploading() {
let uploading = false;
let uploadingList = [];
temporaryFiles.value.forEach(cur => uploadingList.push(cur.status));
if (uploadingList.includes('uploading')) return true;
return uploading;
}
...
</script>
child component
<script setup>
...
function destroy(index, file, type){
URL.revokeObjectURL(file);
props.i_items.splice(index, 1);
props.i_files.splice(index, 1);
if(isAllUploading()) uploading = false;
}
...
</script>
Как получить в child component функцию
isAllUploading и
uploading из родительского компонента?