Now that our users can navigate through the folder structure, we need to add the ability to download the files. Unfortunately, this isn't as simple as accessing a link attribute on the file. To get the download link, we have to query the Dropbox API for each file.
We will query the API on the creation of the file component, this will asynchronously get the download link and show it once available. Before we can do this, we need to make the Dropbox instance available to the file component.
Add a new attribute to the file component in the view, and pass the Dropbox method through as the value:
<file :d="dropbox()" :f="entry"></file>
Add the d variable to the props object of your component accepting an Object:
props: {
f: Object,
d: Object
},
We are now going to add a data attribute of...