title: Assigning a prop value to data in a Vue Component
body: <pre><code>&lt;template&gt;
      &lt;div class="container p-2"&gt;
          &lt;form id="Lookup"&gt;
              &lt;div class="row p-2"&gt;
                  &lt;div class="col-12 input-group "&gt;
                      &lt;input type="text" name="postcode"   :placeholder="initial" v-model="location" class="form-control p-3"&gt;&lt;div class="input-group-append"&gt;&lt;i class="material-icons input-group-text" @click="$emit('findlocation', location)"&gt;location_searching&lt;/i&gt;&lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
      export default{
          props: ['initial'],
          data: function () {
              return {
                location : this.initial
              }
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>The above is my Vue Component which is passed a string value called initial
  This value is passed from the template below</p>
  
  <pre><code>&lt;practicesearch-component @findlocation="getlocation" :initial=postalTown" /&gt;
  </code></pre>
  
  <p>where postalTown is a data property of the main vue</p>
  
  <p>but instead of getting the string value of postalTown in location I get</p>
  
  <blockquote>
    <p>function String() { [native code] }</p>
  </blockquote>
  
  <p>the prop initial in the Vue Component shows the correct string value but location has been assigned a function 
  What am I doing wrong?</p>