Vuejs component wait for facebook sdk to load

前端 未结 2 455
情歌与酒
情歌与酒 2020-12-14 23:07

I have a component that show a login button or username of the user from facebook. depends if he is logged in or not.

Now in this component I use the



        
2条回答
  •  青春惊慌失措
    2020-12-14 23:44

    I was searching forever for a answer to this.

    Thanx to vbranden's comment I was able to get it working for me.

    What you have to do is initialise the facebook sdk in the created method. Then call the login from inside the fbAsyncInit function.

    Here's what worked for me:

    
    

提交回复
热议问题