Displaying your data and using Vue to get it
Now that we can retrieve our data using the Dropbox API, it's time to retrieve it within our Vue instance and display in our view. This app is going to be entirely built using components so we can take advantage of the compartmentalized data and methods. It will also mean the code is modular and shareable, should you want to integrate into other apps.
We are also going to take advantage of the native Vue created()
function - we'll cover it when it gets triggered in a bit.
Create the component
First off, create your custom HTML element, <dropbox-viewer>
, in your View. Create a <script>
template block at the bottom of the page for our HTML layout:
<div id="app">
<dropbox-viewer></dropbox-viewer>
</div>
<script type="text/x-template" id="dropbox-viewer-
template">
<h1>Dropbox</h1>
</script>
Initialize your component in your app.js
file, pointing...