Nuxt.js - How to load plugins in component

Viewed 781

I have google-oauth.js plugin in nuxt application. I load the plugin in nuxt.config.js file.

plugins: [
        { src: '@plugins/google-oauth.js', ssr: false }
   ],

and it works fine. But this loads the plugin before the app mounted. I need it only in 1 component .

1. So is there is any way to load the plugin , once the app fully mounted or in that component only?

I tried the following in component page

export default {
  plugins: [{ src: '@plugins/google-oauth.js', ssr: false }],
  components: {
     CreateEmail
  },
/*  */
}

but it doesn't load the page.

2. Also , is there any way to load the design only in login page in the app, and mount the app once login loaded.

0 Answers
Related