[Vuejs]-Can't access Vue from js

0πŸ‘

βœ…

  1. Replace vue-resource with axios. Easy to do. Vue-resource is not longer maintained by Vue team, so it’s bad choice to use it.( https://medium.com/the-vue-point/retiring-vue-resource-871a82880af4#.dwmy5ymjx )

    Axios is widely supported. https://github.com/mzabriskie/axios .

    Nice laracasts about using axios with vue. You will quickly get it. https://laracasts.com/series/learn-vue-2-step-by-step/episodes/18

  2. It is normal that you can’t access Vue instance in your auth module. Try to learn more about using this and you will quickly get it β€˜why?’

  3. To make ajax requests in your auth module, just import axios and use axios.post / axios.get

Any questions? Comment and I will explain more.

Leave a comment