title: vuejs - bind to component data
body: <p>I've created a simple component:<br>
  <a href="https://jsfiddle.net/s08yhcda/1/" rel="nofollow noreferrer">https://jsfiddle.net/s08yhcda/1/</a></p>
  
  <pre><code>&lt;div id="app"&gt;
    &lt;button-counter&gt;My counter: &lt;span v-text="count"&gt;&lt;/span&gt;&lt;/button-counter&gt;
  &lt;/div&gt;
  
  // Define a new component called button-counter
  Vue.component('button-counter', {
    data: function () {
      return {
        count: 0
      }
    },
    template: '&lt;button v-on:click="count++"&gt;&lt;slot&gt;&lt;/slot&gt;&lt;/button&gt;'
  })
  
  // boot up the demo
  var demo = new Vue({
    el: '#app'
  })
  </code></pre>
  
  <p>Yet I cannot bind to the inner component data (counter). How can a component expose its data to the <code>&lt;slot&gt;</code> scope? I know the "events up, props down" idea. But still I thought it would be possible to bind component data inside its scope (inside the <code>&lt;button-counter&gt;</code> element)</p>
  
  <p>I prefer not using event for something that simple. Any other way?</p>