[Vuejs]-Vue.js Facebook Login

0👍

You could use string interpolation in Vue templates to display that message.

First, add a data property (e.g., named "message"):

export default {
  data() {
    return {
      message: ''
    };
  }
}

Then, add the message in your template, surrounded by curly brackets:

<template>
  <div>{{message}}</div>
</template>

When your Facebook login result is determined, set this.message to the desired message, similar to this:

methods: {
  onSignInSuccess (response) {
    FB.api('/me', dude => {
      this.message = `Good to see you, ${dude.name}.`
    })
  },
  onSignInError (error) {
    this.message = `Error de fBlogin: ${error}`
  },
}
👤tony19

Leave a comment