title: How to get property value from component in vue.js 2.0?
body: <p>I have this component:</p>
  
  <pre><code>&lt;template&gt;
    &lt;div class="animated fadeIn"&gt;
        &lt;div class="col-sm-6 col-lg-6"&gt;
          &lt;datepicker class="form-control" :value="config.state.fromDate" :disabled="config.disabledFrom"&gt;&lt;/datepicker&gt;
        &lt;/div&gt;
          &lt;div class="col-sm-6 col-lg-6"&gt;
          &lt;datepicker :value="config.state.toDate" :disabled="config.disabledTo"&gt;&lt;/datepicker&gt;
        &lt;/div&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import Datepicker from 'vuejs-datepicker'
  var d = new Date()
  
  var year = d.getFullYear()
  var month = d.getMonth()
  var day = d.getDate()
  var fromD = new Date(year - 1, month, day)
  var toDD = new Date(year, month, day)
  
  console.log(fromD.toString())
  console.log(toDD)
  
  export default {
    data() {
      return {
        config: {
          disabledFrom: {
            to: fromD
          },
          disabledTo: {
            from: toDD
          },
          state: {
            fromDate: (d.getDate() - 1).toString(),
            toDate: new Date(year, month, day).toString()
          }
        }
      }
    },
    components: {
      Datepicker
    }
  }
  &lt;/script&gt; 
  </code></pre>
  
  <p>I import this component like so: </p>
  
  <pre><code>import picker from '../components/DateFilter'
  </code></pre>
  
  <p>In this vue I have a button that when clicked i want it to get a property from the component that I am importing:</p>
  
  <pre><code>&lt;template&gt;
  &lt;div class="animated fadeIn"&gt;
       &lt;picker&gt;&lt;/picker&gt;
  &lt;/div&gt;
  &lt;div&gt;
        &lt;button @click="onChange2" class="btn btn-primary"&gt;search&lt;/button&gt;
  &lt;/div&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>the method  has an alert to show me the value: </p>
  
  <pre><code>onChange2: function() {
    alert(picker.datepicker.value)
  }
  </code></pre>
  
  <p>error message: </p>
  
  <blockquote>
    <p>Cannot read property 'value' of undefined</p>
  </blockquote>
  
  <p>other attempts:</p>
  
  <pre><code>  alert(picker.data.config.state.value)
    alert(picker.config.state.value)
  </code></pre>
  
  <p>I am new to vue and I havent been able to figure out where I am doing this wrong. </p>