How to call axios/api call in Nativescript application

后端 未结 2 1262
猫巷女王i
猫巷女王i 2021-02-04 16:37

I\'m trying to build a small application on Nativescript-vue where I\'m having backend laravel framework for api calls which needs to be called to get

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-04 16:48

    The problem has to do with how axios is imported. Try:

    import axios from 'axios/dist/axios'
    

    this also solves the Module not found: Error: Can't resolve 'net' in... error.

    When importing the package normally my requests failed, returning the error

    Error in v-on handler (Promise/async): "Error: Request failed with status code null"
    

提交回复
热议问题