devbaji / vue3-google-login

Add Sign In With Google feature to your Vue 3 application
https://github.com/devbaji/vue3-google-login/
MIT License
202 stars 30 forks source link

Vike SSR Example Suggestion #64

Closed TimJohns closed 1 month ago

TimJohns commented 1 month ago

Thanks for the work on this plug-in. I'm using it with the Vike framework, and would suggest an additional example in the docs at No SSR support:

Vike

In Vike applications, you can use the clientOnly helper, which is used for purposely rendering a component only on client side.

<template>
  <GoogleLogin :callback="googleLoginCallback" client-id="YOUR_GOOGLE_CLIENT_ID"/>
</template>

<script setup lang="ts">
import { clientOnly } from 'vike-vue/clientOnly'
const GoogleLogin = clientOnly(async () => (await import('vue3-google-login')).GoogleLogin);
</script>
devbaji commented 1 month ago

@TimJohns Thanks added to the docs