vuejs push data update parent
snippet in html

vuejs push data update parent

user3117

<!--
 From the child component, you want to do an "emit". This tells the
 parent to run a function which is specified in the child component
 reference. Using Pseudo code here:
-->
<parent>
  <child
    :child-data="data"
    @updateParentData="updateData">
  </child>
  <ChildScript>
    methods: {
      updateParentData() {
    	Vue.$emit('updateParentData', childData);
      }
    }
  </ChildScript>
</parent>
<ParentScript>
  methods: {
    updateData(childData) {
      // Do some stuff with child data
    }
  }
</ParentScript>