vue-google-login-directive

1.1.7 • Public • Published

v-google-login

A simple Vue directive to include Google Login Button behavior in any component.

Install

$ npm install --save vue-google-login-directive
$ yarn add vue-google-login-directive

Vue2

import Vue from 'vue'
import vGoogleLogin from 'vue-google-login-directive'

Vue.use(vGoogleLogin)

Vue 3

import vGoogleLogin from 'vue-google-login-directive'
import { ref } from "vue";

<script setup>
  const googleSettings = ref({
    client_id: "google_client_id",
    OnSuccess: googleCallBackSuccess,
    Onfail: googleCallBackError,
  });

  function googleCallBackSuccess(data) {
    console.log('googleCallBackSuccess', data);
  }

  function googleCallBackError(error) {
    console.log('googleCallBackError', error);
  }
</script>

<template>
  <div v-google-login="googleSettings"></div>
</template>

Looking for the Apple counterpart?

License

MIT © Jhuril Bandola

Package Sidebar

Install

npm i vue-google-login-directive

Weekly Downloads

1

Version

1.1.7

License

MIT

Unpacked Size

23 kB

Total Files

7

Last publish

Collaborators

  • jhuril45