title: Vue.js update ajax data in data property variable
body: <p>I am new in Vue.js. I want to update data from ajax data.</p>
  
  <pre><code>&lt;template&gt;
    &lt;span class="label_cont"&gt;This is to certify that&lt;/span&gt; {{ name }}
  &lt;/template&gt;
  </code></pre>
  
  <p>I want to <code>{{ name }}</code> variable from ajax data. <br>
  Here is my js code</p>
  
  <pre><code>export default{
    created(){
      const url = 'app/result.php';
      this.$http.get(url).then(response =&gt; {
        this.resp = response.body;
      });
    },
    data(){  
      return {
       resp:[],
       name: resp.name,
     }
    }
  }
  </code></pre>
  
  <p>In my ajax <code>name</code> property is in <code>this.resp.name</code></p>
  
  <p><strong>Update:</strong></p>
  
  <p>Here is my ajax response data format</p>
  
  <pre><code>{
    "name": "X",
    "class": "Y",
    "roll": "Z"
  }
  </code></pre>