Nuxt JS Apollo data only available after page refresh

后端 未结 2 1307
北海茫月
北海茫月 2021-01-02 22:26

I am fetching some data using Apollo inside of Nuxt. Somehow, when navigating to that page I get an error of

Cannot read property \'image\' of undefined
         


        
2条回答
  •  别那么骄傲
    2021-01-02 22:50

    I stumbled on this issue as well, and found it hidden in the Vue Apollo documents.

    Although quite similar to the OP's reply, it appears the official way is to use the "$loadingKey" property.

    It's quite confusing in the documents because there are so many things going on. https://vue-apollo.netlify.com/guide/apollo/queries.html#loading-state

    
    
    
    

    If you need to use a reactive property within vue such as a slug, you can do so with the following.

    
    
    
    

提交回复
热议问题