How can I pass the details to the Vue component.
this is how i usually do it.
<child prop="value"></value>
but I want to do it like this
var Child = Vue.extend({ ... }); Chid.passProps( {foo: 'bar'} )
is this possible in vue.js?
this is the full 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);
jsbin link
source share