{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs/Discussion/issues/135","labels_url":"https://api.github.com/repos/vuejs/Discussion/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/Discussion/issues/135/comments","events_url":"https://api.github.com/repos/vuejs/Discussion/issues/135/events","html_url":"https://github.com/vuejs/Discussion/issues/135","id":65544184,"number":135,"title":"Sync data between a Parent VM and a component that uses the <content> tag","user":{"login":"wanderanimrod","id":3718698,"avatar_url":"https://avatars.githubusercontent.com/u/3718698?v=3","gravatar_id":"","url":"https://api.github.com/users/wanderanimrod","html_url":"https://github.com/wanderanimrod","followers_url":"https://api.github.com/users/wanderanimrod/followers","following_url":"https://api.github.com/users/wanderanimrod/following{/other_user}","gists_url":"https://api.github.com/users/wanderanimrod/gists{/gist_id}","starred_url":"https://api.github.com/users/wanderanimrod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wanderanimrod/subscriptions","organizations_url":"https://api.github.com/users/wanderanimrod/orgs","repos_url":"https://api.github.com/users/wanderanimrod/repos","events_url":"https://api.github.com/users/wanderanimrod/events{/privacy}","received_events_url":"https://api.github.com/users/wanderanimrod/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-31T20:58:55Z","updated_at":"2015-05-09T12:56:13Z","closed_at":null,"body":"Hi good people, I have a form that I want to extract out into a component that will be consumed by about 4 other components, the only changes in the consumer components being the actions one can take on the form. So, I was thinking about making the form component have a ```<content>``` insertion tag where consumer components would insert their form action buttons.\r\n\r\nThe problem is that the methods that the specialised buttons will execute will be on the parent-vms yet the form data that the custom actions process is on the base-form component. Is there a way to pass data down to a component's inserted ```<content>``` so that that data will be available on the consumer VM, referred to as 'the Parent VM' in [Vue docs](http://vuejs.org/guide/components.html#Content_Insertion) ?\r\n\r\nHere is some pseudo code describing the problem\r\n\r\n```\r\n//base-form-component.js\r\nbaseForm = {\r\n    template: require('./base-form-template.html'),\r\n    data: function() {\r\n        return {\r\n            client: {\r\n                name: 'Jon Doe',\r\n                age: 34\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n________________________________________________________\r\n\r\n<!-- base-form-template.html --> \r\n<form>\r\n    <input id=name value=\"{{ name }}\">\r\n    <input id=age value=\"{{ age }}\">\r\n    <content>Here is where the custom submit buttons of consumers will be inserted. Those buttons' will perform actions that need to know what data is in the client object.</content>\r\n</form>\r\n\r\n_________________________________________________________________\r\n\r\nparentVM = {\r\n    template: require('./parent-template.html'),\r\n    components: {\r\n        'base-form-component': require('./base-form-component.js')\r\n    },\r\n    methods: {\r\n        createNewClient: function() {\r\n            //pick client from base-component vm and submit via http call.\r\n            //QUESTION: How do you pick the most recent data from the base               component vm?\r\n        }\r\n    }\r\n}\r\n\r\n_______________________________________________________________\r\n\r\n<!-- parent-template.html -->\r\n<base-form-component>\r\n    <button class=\"submit\" v-on=\"click: createNewClient()\"></button>\r\n</base-form-component>\r\n```\r\n\r\nHow do I make sure the parent vm's createNewClient method knows about the base-form-component's client data object when the submit button in the parent-vm-template is clicked?"},"comment":{"url":"https://api.github.com/repos/vuejs/Discussion/issues/comments/100479153","html_url":"https://github.com/vuejs/Discussion/issues/135#issuecomment-100479153","issue_url":"https://api.github.com/repos/vuejs/Discussion/issues/135","id":100479153,"user":{"login":"wanderanimrod","id":3718698,"avatar_url":"https://avatars.githubusercontent.com/u/3718698?v=3","gravatar_id":"","url":"https://api.github.com/users/wanderanimrod","html_url":"https://github.com/wanderanimrod","followers_url":"https://api.github.com/users/wanderanimrod/followers","following_url":"https://api.github.com/users/wanderanimrod/following{/other_user}","gists_url":"https://api.github.com/users/wanderanimrod/gists{/gist_id}","starred_url":"https://api.github.com/users/wanderanimrod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wanderanimrod/subscriptions","organizations_url":"https://api.github.com/users/wanderanimrod/orgs","repos_url":"https://api.github.com/users/wanderanimrod/repos","events_url":"https://api.github.com/users/wanderanimrod/events{/privacy}","received_events_url":"https://api.github.com/users/wanderanimrod/received_events","type":"User","site_admin":false},"created_at":"2015-05-09T12:56:13Z","updated_at":"2015-05-09T12:56:13Z","body":"Thanks a lot!"}}