Article From:


        path: '/home/:id',
        component: Home,


I mounted this. $route. params in App. Vue to print this. $route. params to refresh the first time an empty object would appear. I couldn’t find this. $route. params. id, using setIntervAl100 milliseconds print, the first time out, the second time normal, 200 milliseconds may not come out for the first time blank situation, which may be why

Library version: vue-router 2.7.0 vue.2.4.2

It seems that I introduced it in the following way, and the following is the way to learn others.
const Work = (resolve)=>{


It's okay to switch to direct introduction, like = =!

Answer 0:

You’re loading components asynchronously, and in the mounted lifecycle, it’s possible that you haven’t loaded them yet, so you can’t get them

Leave a Reply

Your email address will not be published. Required fields are marked *