title: How to fetch data in Vue 3?
body: <p>I don't know how to fetch data with Vue 3? I created one action and with this action I am calling endpoint (<a href="https://api.openbrewerydb.org/breweries/5494" rel="nofollow noreferrer">https://api.openbrewerydb.org/breweries/5494</a>). I didn't get response data.</p>
  <p>Endpoint:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { createStore } from 'vuex'
  
  export default createStore({
    state: {
    },
    mutations: {
    },
    actions: {
      async getData() {
        await fetch('https://api.openbrewerydb.org/breweries/5494', {
          method: 'get',
          headers: { 'Content-type': 'application/json' },
        }).then((response) =&gt; {
          if (!response.ok) {
            throw Error(response.statusText);
          }
          console.log('response: ', response)
        }).catch((error) =&gt; {
          console.log('Looks like there was a problem: \n', error);
        });
      }
    },
    modules: {
    }
  })</code></pre>
  </div>
  </div>
  </p>
  <p>Vue component:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;template&gt;
    &lt;div @click="loadData"&gt;Load Data&lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import { useStore } from 'vuex'
  
  export default {
    name: 'HelloWorld',
    props: {
      msg: String
    },
  
    setup () {
      const store = useStore()
  
      const loadData = () =&gt; {
        store.dispatch('getData')
      }
  
      return { loadData }
    }
  }
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>As a response I didn't get anything but I should get:</p>
  <pre><code>{&quot;id&quot;:5494,&quot;name&quot;:&quot;MadTree Brewing&quot;,&quot;brewery_type&quot;:&quot;regional&quot;,&quot;street&quot;:&quot;3301 Madison Rd&quot;,&quot;address_2&quot;:null,&quot;address_3&quot;:null,&quot;city&quot;:&quot;Cincinnati&quot;,&quot;state&quot;:&quot;Ohio&quot;,&quot;county_province&quot;:null,&quot;postal_code&quot;:&quot;45209-1132&quot;,&quot;country&quot;:&quot;United States&quot;,&quot;longitude&quot;:&quot;-84.4239715&quot;,&quot;latitude&quot;:&quot;39.1563725&quot;,&quot;phone&quot;:&quot;5138368733&quot;,&quot;website_url&quot;:&quot;http://www.madtreebrewing.com&quot;,&quot;updated_at&quot;:&quot;2018-08-24T15:44:22.281Z&quot;,&quot;created_at&quot;:&quot;2018-07-24T01:34:01.620Z&quot;}
  </code></pre>