vue-google-signin button To include the behavior of the Google sign-in button in any component.
Important: OnGoogleAuthSuccess
and OnGoogleAuthFail
are mandatory methods that you must declare in your component where you are using the directive.
How to make use of it:
Install & Download:
$ npm install --save vue-google-signin-button-directive $ yarn add vue-google-signin-button-directive
Import the directive and attach it to any component.
<template> <button v-google-signin-button="clientId" class="google-signin-button"> Continue with Google</button> </template>
<script> import GoogleSignInButton from 'vue-google-signin-button-directive' export default { directives: { GoogleSignInButton }, data: () => ({ clientId: 'Your_Google_Client-Id' }), methods: { OnGoogleAuthSuccess (idToken) { // Receive the idToken and make your magic with the backend }, OnGoogleAuthFail (error) { console.log(error) } } } </script>
google sign-in button component, vue-google-signin-button-directive Plugin/Github
See Demo And Download
Official Website(mejiamanuel57): Click Here
This superior jQuery/javascript plugin is developed by mejiamanuel57. For extra advanced usage, please go to the official website.