Including and initializing Vuex
The Vuex library is included the same way as Vue itself. You can either use a hosted version by using the previously mentioned unpkg service (https://unpkg.com/vuex) or you can download the JavaScript library from their https://github.com/vuejs/vuex.
Add a new <script>
block to the bottom of your HTML file. Ensure the Vuex library is included after your vue.js
library but before your application JavaScript:
<script type="text/javascript" src="js/vue.js"></script>
<script type="text/javascript" src="js/vuex.js"></script>
<script type="text/javascript" src="js/dropbox.js"></script>
<script type="text/javascript" src="js/app.js"></script>
Note
If you are deploying an app with several JavaScript files, it is worth investigating whether it is more efficient to combine and compress them into one file or configure your server to use HTTP/2 push.
With the library included, we can initialize and include the store within...