Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

92
Views
Cómo configurar VueGapi como global en la aplicación Vue 3

Estoy tratando de usar el complemento VueGapi para una aplicación de Gmail en Vue. Aquí está mi main.js

 import { createApp } from 'vue' import App from './App.vue' import VueGapi from 'vue-gapi' const app = createApp(App).mount('#app') app.use(VueGapi, { apiKey: 'my_key', clientId: 'my_client_id', discoveryDocs: ['https://sheets.googleapis.com/$discovery/rest?version=v4'], scope: 'https://www.googleapis.com/auth/spreadsheets', })

Cuando trato de hacer referencia a él con this.$gapi obtengo el Uncaught TypeError: this.$gapi is undefined

¡Un poco nuevo en Vue, por lo que agradecería cualquier ayuda!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

La función .mount no devuelve una aplicación vue, es por eso que no puede hacer un use después.

Primero debe create , después de use y terminar de mount :

 import { createApp } from 'vue' import App from './App.vue' import VueGapi from 'vue-gapi' const app = createApp(App) app.use(VueGapi, { apiKey: 'my_key', clientId: 'my_client_id', discoveryDocs: ['https://sheets.googleapis.com/$discovery/rest?version=v4'], scope: 'https://www.googleapis.com/auth/spreadsheets', }) app.mount('#app')

También debe asegurarse de usar Vue 3 (verifique la versión de vue en su package.json ) y use el paquete vue-gapi correspondiente ( https://www.npmjs.com/package/vue-gapi )

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!