Open weblee opened 8 years ago
Sorry Matt,
Forgot to say you will need to pull in Promise and add to your app.js file ie.
window.Promise = require('promise');
Worth a read Matt: http://vuejs.github.io/vue-router/en/pipeline/data.html You will see the benefits of loading via the router hooks. What got me into this was Vue started to complain it was trying to load data on the page which was not present yet. Hence I had to add a promise.. Maybe because it was a larger data set :-)
@weblee FYI, hoping to come back to this soon--I'm excited to learn about it, and appreciate you sharing!
Hey Matt,
Not sure if you have seen this yet but the Router has a nice set of methods you can use to load data and display loading text/images. It does it through a promise so the page will load and the data will load asynchronous. See more here: http://vuejs.github.io/vue-router/en/pipeline/hooks.html
Will give the user a better experience if the http response is slow or allot of data :-)