December 2017
Beginner to intermediate
412 pages
8h 35m
English
Create a new property in your data object titled structure, and assign this to an empty array. In the response function of the folder retrieval, assign response.entries to this.structure. Leave console.log as we will need to inspect the entries to work out what to output in our template:
Vue.component('dropbox-viewer', { template: '#dropbox-viewer-template', data() { return { accessToken: 'XXXX', structure: [] } }, methods: { dropbox() { return new Dropbox({ accessToken: this.accessToken }); }, getFolderStructure(path) { this.dropbox().filesListFolder({path: path}) .then(response => { console.log(response.entries); this.structure = response.entries; }) .catch(error => { console.log(error); }); } }, created() ...Read now
Unlock full access