search

Home  >  Q&A  >  body text

javascript - Is there any way for vue-router to load the component after loading the data?

Is there any way to load the data first and then load the component? Now the structure is loaded but the data is not visible and it is ugly.

習慣沉默習慣沉默2791 days ago554

reply all(2)I'll reply

  • 高洛峰

    高洛峰2017-05-16 13:39:09

    You can use placeholder image first. Like Tencent News. When opening the page, first display the placeholder image

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-16 13:39:09

    This can be achieved through routing hooks.
    vue-router2.x api: http://router.vuejs.org/zh-cn...
    vue-router1.x example: /a/11...

    reply
    0
  • Cancelreply