title: How to use async/await in Vue.js?
body: <p>I'm new in ES7</p>
  
  <p>I want to use async/await in Vue.js</p>
  
  <p>Here is my code</p>
  
  <pre><code>created (){
      this.getA()
      console.log(2)
      this.getB() 
  },
  methods : {
      getA (){
          console.log(1)
      },
      getB (){
          console.log(3)
      }
  }
  </code></pre>
  
  <p>It returns </p>
  
  <pre><code>1
  2
  3
  </code></pre>
  
  <p>But when I use it with axios, then</p>
  
  <pre><code>created (){
      this.getA()
      console.log(2)
      this.getB() 
  },
  methods : {
      getA (){
          $axios.post(`/getA`,params){
          .then((result) =&gt; {
              console.log(1)
          })
      },
      getB (){
          console.log(3)
      }
  }
  </code></pre>
  
  <p>It returns </p>
  
  <pre><code>2
  3
  1
  </code></pre>
  
  <p>So I want to add async/await in that code. </p>
  
  <p>How can I use async/await?</p>
  
  <p>I tried </p>
  
  <pre><code>async created (){
      await this.getA()
      console.log(2)
      await this.getB() 
  },
  methods : {
      getA (){
          $axios.post(`/getA`,params){
          .then((result) =&gt; {
              console.log(1)
          })
      },
      getB (){
          console.log(3)
      }
  }
  </code></pre>
  
  <p>It returns same result.</p>