title: "TypeError: can't access property "get", vue__WEBPACK_IMPORTED_MODULE_0__.default.axios is undefined"
body: <p>I got a problem with using vue with axios it says:</p>
  <p>[Vue warn]: Error in created hook: &quot;TypeError: can't access property &quot;get&quot;, vue__WEBPACK_IMPORTED_MODULE_0__.default.axios is undefined&quot;</p>
  <p>here is my code</p>
  <p>Api.service.js</p>
  <pre><code>import Vue from &quot;vue&quot;;
  import axios from &quot;axios&quot;;
  import VueAxios from &quot;vue-axios&quot;;
  import JwtService from &quot;./jwt.service&quot;;
  
  
  const ApiService = {
      init() {
  
          Vue.use(VueAxios, axios);
          axios.defaults.baseURL = &quot;http://hyper.test/api&quot;;
      },
  }
  </code></pre>
  <p>BannerDataService.js:</p>
  <pre><code>import ApiService from &quot;../api.service&quot;;
  
  class BannerDataService {
      constructor() {
          // ApiService.setHeader();
          // ApiService.adminScope();
      }
  
      all() {
          return ApiService.get('site/banners')
      }
  
      get(id) {
          return ApiService.get(`site/banners/${id}`)
      }
  }
  
  export default new BannerDataService();
  </code></pre>
  <p>Index.vue:</p>
  <pre><code>getBanners() {
              BannerDataService.all().then(response =&gt; {
                  console.debug(response)
              }).catch(err =&gt; {
                  console.debug(err)
              })
          }
  
  </code></pre>
  <p>error console:</p>
  <pre><code>[Vue warn]: Error in created hook: &quot;TypeError: can't access property &quot;get&quot;, vue__WEBPACK_IMPORTED_MODULE_0__.default.axios is undefined&quot;
  </code></pre>