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

235
Views
vuejs3: no se pueden importar axios globalmente

Puedo importar y usar axios en un componente:

 import axios from 'axios' export default function usePostLogin() { const login = async (url , data , callback) => { axios.post(url, data) // etc

Quiero importar axios globalmente.

En principal.js:

 import axios from 'axios' const app = createApp(App) app.component('FontAwesome', FontAwesomeIcon) app.use(createPinia()).use(router).use(axios) app.mount('#app')

Pero luego aparece un error: error 'axios' is not defined no-undef

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

0

No puede agregar axios con use en Vue3, en main.js agréguelo a la propiedad global:

 app.config.globalProperties.axios = axios

y en componente usarlo como:

 this.axios
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!