title: vuejs : passing props down to a component in javascript?
body: <p>How can i pass down props to a javascript <a href="https://v2.vuejs.org/v2/guide/components.html#Props" rel="nofollow noreferrer">Vue component</a>.</p>
  <p>this is how i normally do it.</p>
  <pre><code>&lt;child prop=&quot;value&quot;&gt;&lt;/value&gt;
  </code></pre>
  <p>but i want to do it like this</p>
  <pre><code>var Child = Vue.extend({
      ...
  });
  Chid.passProps( {foo: 'bar'} ) // some thing like this?
  </code></pre>
  <p>is this possible in vue.js?</p>
  <p>this is the full code:</p>
  <pre><code>var Child = Vue.extend({
      props: ['foo'],
      methods: {
          printIt: function() {
              console.log(this.foo)
          }
      },
      template: '#example'
  });
  var vm = new Vue({
      el: '#root',
      data: {
          foo: 'bar'
      },
      render: function(createElement) {
          return createElement(Child); // pass down foo
      }
  });
  </code></pre>
  <p><a href="http://jsbin.com/dacoqa/edit?html,js,console,output" rel="nofollow noreferrer">link to jsbin</a></p>