title: how can I set a global function for call Apis in NUXT?
body: <p>after some google searched,
  I am doing this in plugins/callApi.js</p>
  <pre><code>import axios from 'axios';
  import Vue from 'vue';
  Vue.use(callApi);
  
  export default async (apiUrl, postData, headers = {}) =&gt; {
    let msg = await axios.post(https://my-api-location.com' + apiUrl,postData);
    return msg.data;
  };
  </code></pre>
  <p>then set in nuxt.config.js</p>
  <pre><code>plugins: [
      '~plugins/callApi.js']
  </code></pre>
  <p>when I want to use it</p>
  <pre><code>const msgData = await callApi('/api/news/getNewsList', postData);
  if (msgData.response === 'success') { .......
  </code></pre>
  <p>but when I start yarn dev, it hightlight &quot;Vue.use(callApi);&quot; part and says &quot;callApi is not defined&quot;</p>
  <p>how cant I fix it? thanks a lot :)</p>