Skip to content
This repository was archived by the owner on Mar 30, 2022. It is now read-only.

Conversation

@weblee
Copy link

@weblee weblee commented Dec 10, 2015

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 :-)

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  :-)
@weblee
Copy link
Author

weblee commented Dec 10, 2015

Sorry Matt,

Forgot to say you will need to pull in Promise and add to your app.js file ie.

window.Promise = require('promise');

@weblee
Copy link
Author

weblee commented Dec 10, 2015

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 :-)

@mattstauffer
Copy link
Owner

@weblee FYI, hoping to come back to this soon--I'm excited to learn about it, and appreciate you sharing!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants