How can I pass a value from a method to another function in Vue.js?
I have a value in my method, but I need to pass this value to another function. How can I achieve this?
methods: {
getDataSource() {
let self = this;
arr.forEach((item) => {
//debugger;
let tokens = item.path.replace(/^\/|\/$/g, "").split("/");
let fid = item.fid;
let current = tree;
for (let i = 0; i < tokens.length; i++) {
if (!current[tokens[i]]) {
current[tokens[i]] = {
fid: item.fid
};
}
current = current[tokens[i]];
}
let ffid = Number(item.fid) + 1;
//console.log(ffid);
});
}
function uploadFileChunk(fileData, uploadInfo, destinationDirectory) {
let self = this;
//debugger
let reader = new FileReader();
reader.onload = function() {
console.log(reader.result);
}
reader['readAsDataURL'](fileData);
return objectProvider.uploadFileChunk(
fileData,
uploadInfo,
destinationDirectory
);
}
I want to pass the value of ffid to the function uploadFileChunk. How can I retrieve the ffid values?